[TuT] Djurine Kućne Čarolije - Kako napraviti Race (GF)

Započeo zerocoolos, Avgust 29, 2009, 22:30:47 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 3 gostiju pregledaju ovu temu.

Citat: SoaD123 poslato April 19, 2010, 16:46:36 POSLE PODNE
Evo kako sam ja to radio:
new drag[MAX_PLAYERS];
new dragrace;


pod forward:

forward UtrkaTimer();
forward UtrkaTimer2();
forward UtrkaTimer3();


dragrace = CreateObject(982, 2050.7309570313, -2493.9169921875, 13.230429649353, 0, 0, 0);

onplayercommand:
if(strcmp(cmd, "/dragracer", true) == 0)
{
   if(IsPlayerConnected(playerid))
   {
    tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Pisi: /dragracer [id igraca/Dio imena]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if (PlayerInfo[playerid][pAdmin] >= 1)
{
if(IsPlayerConnected(giveplayerid))
{
                   if(giveplayerid != INVALID_PLAYER_ID)
   {
   GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "DragRace: %s, tebi je admin %s aktivirao utrku", giveplayer, sendername);
SendClientMessage(giveplayerid,COLOR_RED, string);
format(string, sizeof(string), "[DragRace]Igracu %s je utrku aktivirao admin %s", giveplayer, sendername);
SendAdminMessage(COLOR_GREEN, string);
                       SetPlayerRaceCheckpoint(giveplayerid, 1,1465.1482,-2493.8542,13.1253,0,0,0,20);
                       drag[giveplayerid] = 100;
}
}
}
else
{
format(string, sizeof(string), "   %d nije aktivan igrac.", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
return 1;
}
if(strcmp(cmd, "/startdragrace", true) == 0)
{
if (PlayerInfo[playerid][pAdmin] >= 1)
{
        GetPlayerName(playerid, sendername, sizeof(sendername));
            SendClientMessage(playerid, COLOR_GREEN, "Aktivirao si utrku");
            format(string, sizeof(string),"*Admin %s je aktivirao DragRace",sendername);
            SendAdminMessage(COLOR_RED,string);
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
       if(IsPlayerConnected(i))
       {
                  if(drag[giveplayerid] == 100)
          {
                      SendClientMessage(i,COLOR_BLUE, "Utrka ce startati za 3 sekunde");
                      GameTextForPlayer(i, "3",1000,6);
                      SetTimer("UtrkaTimer",1000,0);
      }
       }
        }
}
return 1;
}


public OnPlayerEnterRaceCheckpoint(playerid);

new string[128];
new name[MAX_PLAYER_NAME];
if(drag[playerid] == 100){ DisablePlayerRaceCheckpoint(playerid);
SetPlayerRaceCheckpoint(playerid, 1,1465.1482,-2493.8542,13.1253,0,0,0,20);
drag[playerid] =101;}
else if(drag[playerid] == 101) {DisablePlayerRaceCheckpoint(playerid);
{
drag[playerid] = 0;
DisablePlayerRaceCheckpoint(playerid);
  GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "DragRace : %s je upravo zavrsio utrku ", name);
SendClientMessageToAll(COLOR_LIGHTRED, string);
}
}
return 1;
}


i na kraj skripte:

public UtrkaTimer()
{
    new giveplayerid;
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
     if(drag[giveplayerid] == 100)
    {
              GameTextForPlayer(i, "2",1000,6);
              SetTimer("UtrkaTimer2",1000,0);
}
}
}
}
public UtrkaTimer2()
{
    new giveplayerid;
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
     if(drag[giveplayerid] == 100)
    {
              GameTextForPlayer(i, "1",1000,6);
              SetTimer("UtrkaTimer3",1000,0);
}
}
}
}
public UtrkaTimer3()
{
    new giveplayerid;
    MoveObject(dragrace,2050.73046875,-2493.9169921875,11.190228462219, 4.0);//znaci kapija se automatski spusta kad timer kaze start
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
             if(drag[giveplayerid] == 100)
    {
              GameTextForPlayer(i, "START !!!",1000,6);
}
}
}
}

i tak je men, invitam se na utrku, aktivram utrku i dodem na prvi cp i nis
evo moj cod

public OnPlayerEnterCheckpoint(playerid)
{
    if(PlayerInfo[playerid][pUtrka] >= 2)
{
               if(PlayerToPoint(5.0, playerid, 1618.3621,-1725.6051,3.7159))//cp1
               {
                       if(PlayerInfo[playerid][pUtrka] == 3)
                       {
                            DisablePlayerRaceCheckpoint(playerid);
                            PlayerInfo[playerid][pUtrka] = 3;
                           
                            SetPlayerRaceCheckpoint(playerid, 0, 1630.9906,-1764.9762,3.7915, 1982.5056,-1849.8158,3.8735, 5.0);// kao sto vidite u race cp unosite iduci cp i onaj iza njega
   }
               }
               if(PlayerToPoint(5.0, playerid,1630.9906,-1764.9762,3.7915))//cp2
               {
                       if(PlayerInfo[playerid][pUtrka] == 3)
                       {
    DisablePlayerRaceCheckpoint(playerid);
                            PlayerInfo[playerid][pUtrka] = 4;
                           
                            SetPlayerRaceCheckpoint(playerid, 0, 1982.5056,-1849.8158,3.8735, 2416.0830,-1848.7604,1.2584, 5.0);
   }
               }
               if(PlayerToPoint(5.0, playerid,1982.5056,-1849.8158,3.8735))//cp2
               {
                       if(PlayerInfo[playerid][pUtrka] == 4)
                       {
    DisablePlayerRaceCheckpoint(playerid);
                            PlayerInfo[playerid][pUtrka] = 5;
                           
                            SetPlayerRaceCheckpoint(playerid, 0, 2416.0830,-1848.7604,1.2584, 2587.9768,-1595.2267,4.1636, 5.0);
   }
               }
               
               if(PlayerToPoint(5.0, playerid,2416.0830,-1848.7604,1.2584))//cp n-ti
               {
                       if(PlayerInfo[playerid][pUtrka] == 5)
                       {
                            SendClientMessage(playerid, COLOR_YELLOW, "Prosao si kroz cilj");
PlayerInfo[playerid][pUtrka] = 6;//da mozete i dalje vidjeti kad prolaze kroz cilj
                            DisablePlayerRaceCheckpoint(playerid);
//-------------------[Ovo je da svi oni koji su na raceu vide kad prodjete kroz cilj]
                            new string[128];
                        new sendername[MAX_PLAYER_NAME];
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        for(new i = 0; i < MAX_PLAYERS; i++)
                            {
           if(IsPlayerConnected(i))
           {
                                    if(PlayerInfo[i][pUtrka] > 0)
                {
                            format(string, sizeof(string), "|| = Phoenix Race: %s = ||",sendername);
                            SendClientMessage(i,COLOR_WHITE , string);
                }
           }
                             }

//-----------------------------------------------------------------------------
   }
               }
}

I timer jer ovo drugo nije tak vazno

public UtrkaTimer()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
    if(PlayerInfo[i][pUtrka] == 1)
    {
              GameTextForPlayer(i, "2",1000,6);
              SetTimer("UtrkaTimer2",1000,0);
}
}
}
}
public UtrkaTimer2()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
    if(PlayerInfo[i][pUtrka] == 1)
    {
              GameTextForPlayer(i, "1",1000,6);
              SetTimer("UtrkaTimer3",1000,0);
}
}
}
}
public UtrkaTimer3()
{
    MoveObject(utrkakapija,1617.6695556641, -1664.7639160156, 11.683554649353, 2.00);//znaci kapija se automatski spusta kad timer kaze start
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
    if(PlayerInfo[i][pUtrka] == 1)
    {
              GameTextForPlayer(i, "START !!!",1000,6);
              SetPlayerRaceCheckpoint(i, 0, 1618.3621,-1725.6051,3.7159, 1630.9906,-1764.9762,3.7915, 5.0);//cp 1
              PlayerInfo[i][pUtrka] = 2;
}
}
}
}

HELP

Citat: [BM]Alen_Sudec poslato Maj 21, 2010, 20:37:59 POSLE PODNE
Citat: SoaD123 poslato April 19, 2010, 16:46:36 POSLE PODNE
Evo kako sam ja to radio:
new drag[MAX_PLAYERS];
new dragrace;


pod forward:

forward UtrkaTimer();
forward UtrkaTimer2();
forward UtrkaTimer3();


dragrace = CreateObject(982, 2050.7309570313, -2493.9169921875, 13.230429649353, 0, 0, 0);

onplayercommand:
if(strcmp(cmd, "/dragracer", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
    tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Pisi: /dragracer [id igraca/Dio imena]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if (PlayerInfo[playerid][pAdmin] >= 1)
{
if(IsPlayerConnected(giveplayerid))
{
                    if(giveplayerid != INVALID_PLAYER_ID)
    {
    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "DragRace: %s, tebi je admin %s aktivirao utrku", giveplayer, sendername);
SendClientMessage(giveplayerid,COLOR_RED, string);
format(string, sizeof(string), "[DragRace]Igracu %s je utrku aktivirao admin %s", giveplayer, sendername);
SendAdminMessage(COLOR_GREEN, string);
                        SetPlayerRaceCheckpoint(giveplayerid, 1,1465.1482,-2493.8542,13.1253,0,0,0,20);
                        drag[giveplayerid] = 100;
}
}
}
else
{
format(string, sizeof(string), "   %d nije aktivan igrac.", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
return 1;
}
if(strcmp(cmd, "/startdragrace", true) == 0)
{
if (PlayerInfo[playerid][pAdmin] >= 1)
{
         GetPlayerName(playerid, sendername, sizeof(sendername));
             SendClientMessage(playerid, COLOR_GREEN, "Aktivirao si utrku");
             format(string, sizeof(string),"*Admin %s je aktivirao DragRace",sendername);
             SendAdminMessage(COLOR_RED,string);
         for(new i = 0; i < MAX_PLAYERS; i++)
         {
        if(IsPlayerConnected(i))
        {
                   if(drag[giveplayerid] == 100)
           {
                       SendClientMessage(i,COLOR_BLUE, "Utrka ce startati za 3 sekunde");
                       GameTextForPlayer(i, "3",1000,6);
                       SetTimer("UtrkaTimer",1000,0);
       }
        }
         }
}
return 1;
}


public OnPlayerEnterRaceCheckpoint(playerid);

new string[128];
new name[MAX_PLAYER_NAME];
if(drag[playerid] == 100){ DisablePlayerRaceCheckpoint(playerid);
SetPlayerRaceCheckpoint(playerid, 1,1465.1482,-2493.8542,13.1253,0,0,0,20);
drag[playerid] =101;}
else if(drag[playerid] == 101) {DisablePlayerRaceCheckpoint(playerid);
{
drag[playerid] = 0;
DisablePlayerRaceCheckpoint(playerid);
  GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "DragRace : %s je upravo zavrsio utrku ", name);
SendClientMessageToAll(COLOR_LIGHTRED, string);
}
}
return 1;
}


i na kraj skripte:

public UtrkaTimer()
{
    new giveplayerid;
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
     if(drag[giveplayerid] == 100)
    {
              GameTextForPlayer(i, "2",1000,6);
              SetTimer("UtrkaTimer2",1000,0);
}
}
}
}
public UtrkaTimer2()
{
    new giveplayerid;
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
     if(drag[giveplayerid] == 100)
    {
              GameTextForPlayer(i, "1",1000,6);
              SetTimer("UtrkaTimer3",1000,0);
}
}
}
}
public UtrkaTimer3()
{
    new giveplayerid;
    MoveObject(dragrace,2050.73046875,-2493.9169921875,11.190228462219, 4.0);//znaci kapija se automatski spusta kad timer kaze start
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
             if(drag[giveplayerid] == 100)
    {
              GameTextForPlayer(i, "START !!!",1000,6);
}
}
}
}

i tak je men, invitam se na utrku, aktivram utrku i dodem na prvi cp i nis
evo moj cod

public OnPlayerEnterCheckpoint(playerid)
{
    if(PlayerInfo[playerid][pUtrka] >= 2)
{
               if(PlayerToPoint(5.0, playerid, 1618.3621,-1725.6051,3.7159))//cp1
               {
                       if(PlayerInfo[playerid][pUtrka] == 3)
                       {
                            DisablePlayerRaceCheckpoint(playerid);
                            PlayerInfo[playerid][pUtrka] = 3;
                           
                            SetPlayerRaceCheckpoint(playerid, 0, 1630.9906,-1764.9762,3.7915, 1982.5056,-1849.8158,3.8735, 5.0);// kao sto vidite u race cp unosite iduci cp i onaj iza njega
   }
               }
               if(PlayerToPoint(5.0, playerid,1630.9906,-1764.9762,3.7915))//cp2
               {
                       if(PlayerInfo[playerid][pUtrka] == 3)
                       {
    DisablePlayerRaceCheckpoint(playerid);
                            PlayerInfo[playerid][pUtrka] = 4;
                           
                            SetPlayerRaceCheckpoint(playerid, 0, 1982.5056,-1849.8158,3.8735, 2416.0830,-1848.7604,1.2584, 5.0);
   }
               }
               if(PlayerToPoint(5.0, playerid,1982.5056,-1849.8158,3.8735))//cp2
               {
                       if(PlayerInfo[playerid][pUtrka] == 4)
                       {
    DisablePlayerRaceCheckpoint(playerid);
                            PlayerInfo[playerid][pUtrka] = 5;
                           
                            SetPlayerRaceCheckpoint(playerid, 0, 2416.0830,-1848.7604,1.2584, 2587.9768,-1595.2267,4.1636, 5.0);
   }
               }
               
               if(PlayerToPoint(5.0, playerid,2416.0830,-1848.7604,1.2584))//cp n-ti
               {
                       if(PlayerInfo[playerid][pUtrka] == 5)
                       {
                            SendClientMessage(playerid, COLOR_YELLOW, "Prosao si kroz cilj");
PlayerInfo[playerid][pUtrka] = 6;//da mozete i dalje vidjeti kad prolaze kroz cilj
                            DisablePlayerRaceCheckpoint(playerid);
//-------------------[Ovo je da svi oni koji su na raceu vide kad prodjete kroz cilj]
                            new string[128];
                        new sendername[MAX_PLAYER_NAME];
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        for(new i = 0; i < MAX_PLAYERS; i++)
                            {
           if(IsPlayerConnected(i))
           {
                                    if(PlayerInfo[i][pUtrka] > 0)
                {
                            format(string, sizeof(string), "|| = Phoenix Race: %s = ||",sendername);
                            SendClientMessage(i,COLOR_WHITE , string);
                }
           }
                             }

//-----------------------------------------------------------------------------
   }
               }
}

I timer jer ovo drugo nije tak vazno

public UtrkaTimer()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
    if(PlayerInfo[i][pUtrka] == 1)
    {
              GameTextForPlayer(i, "2",1000,6);
              SetTimer("UtrkaTimer2",1000,0);
}
}
}
}
public UtrkaTimer2()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
    if(PlayerInfo[i][pUtrka] == 1)
    {
              GameTextForPlayer(i, "1",1000,6);
              SetTimer("UtrkaTimer3",1000,0);
}
}
}
}
public UtrkaTimer3()
{
    MoveObject(utrkakapija,1617.6695556641, -1664.7639160156, 11.683554649353, 2.00);//znaci kapija se automatski spusta kad timer kaze start
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
    if(PlayerInfo[i][pUtrka] == 1)
    {
              GameTextForPlayer(i, "START !!!",1000,6);
              SetPlayerRaceCheckpoint(i, 0, 1618.3621,-1725.6051,3.7159, 1630.9906,-1764.9762,3.7915, 5.0);//cp 1
              PlayerInfo[i][pUtrka] = 2;
}
}
}
}

HELP

Oce li netko odgovoriti ovom decku xD
Imam isti problem :S



jebu me ovi cp odman me porta na zadnji ali sve u svemu odlicno
Poslednja Izmena: Septembar 03, 2010, 16:36:20 POSLE PODNE od Ante_Dracar aka Lopa

Ljudi, trebam malu pomoc.
Naime radio sam race prema ovom tutu, i dodavao, CP-ove, i krene utrka i sve, prvi cp pokaze, i kad dodjem na taj cp, nece uopce da dalje nastavi pokazivat cp-ove. nzm u cem je problem.

Evo code kako sam radio, pa ak netko zna...

public UtrkaTimer4()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
    if(PlayerInfo[i][pUtrka1] == 1)
    {
              GameTextForPlayer(i, "2",1000,6);
              SetTimer("UtrkaTimer5",1000,0);
}
}
}
}
public UtrkaTimer5()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
    if(PlayerInfo[i][pUtrka1] == 1)
    {
              GameTextForPlayer(i, "1",1000,6);
              SetTimer("UtrkaTimer6",1000,0);
}
}
}
}
public UtrkaTimer6()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
    if(PlayerInfo[i][pUtrka1] == 1)
    {
              GameTextForPlayer(i, "START !!!",1000,6);
              SetPlayerRaceCheckpoint(i, 0, -2279.8643,-1728.5593,470.1421, -2343.3291,-1816.8014,434.2834, 10);
              PlayerInfo[i][pUtrka1] = 2;
}
}
}
}


I evo nastavak dodavanja, cp-ova.....Ali nisam do kraja sve postavio, samo nekoliko da vidim oce to uopce raditi, i ispostavilo se da ne radi....
    if(PlayerInfo[playerid][pUtrka1] >= 2)
{
if(PlayerToPoint(5, playerid,-2279.8643,-1728.5593,470.1421))//cp1
{
if(PlayerInfo[playerid][pUtrka1] == 2)
{
PlayerInfo[playerid][pUtrka1] = 3;
                SetPlayerRaceCheckpoint(playerid, 0, -2343.3291,-1816.8014,434.2834, -2426.4685,-1738.7672,434.1338, 10);// kao sto vidite u race cp unosite iduci cp i onaj iza njega
}
        }
        if(PlayerToPoint(10, playerid,-2343.3291,-1816.8014,434.2834))//cp2
        {
        if(PlayerInfo[playerid][pUtrka1] == 3)
        {
PlayerInfo[playerid][pUtrka1] = 4;
                SetPlayerRaceCheckpoint(playerid, 0, -2426.4685,-1738.7672,434.1338, -2441.1936,-1785.4551,414.7432, 10);
}
}
}


Hvala unaprijed

Citat: Moonwalker poslato Novembar 08, 2010, 19:02:08 POSLE PODNE
Ljudi, trebam malu pomoc.
Naime radio sam race prema ovom tutu, i dodavao, CP-ove, i krene utrka i sve, prvi cp pokaze, i kad dodjem na taj cp, nece uopce da dalje nastavi pokazivat cp-ove. nzm u cem je problem.

Evo code kako sam radio, pa ak netko zna...

public UtrkaTimer4()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
    if(PlayerInfo[i][pUtrka1] == 1)
    {
              GameTextForPlayer(i, "2",1000,6);
              SetTimer("UtrkaTimer5",1000,0);
}
}
}
}
public UtrkaTimer5()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
    if(PlayerInfo[i][pUtrka1] == 1)
    {
              GameTextForPlayer(i, "1",1000,6);
              SetTimer("UtrkaTimer6",1000,0);
}
}
}
}
public UtrkaTimer6()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
    if(PlayerInfo[i][pUtrka1] == 1)
    {
              GameTextForPlayer(i, "START !!!",1000,6);
              SetPlayerRaceCheckpoint(i, 0, -2279.8643,-1728.5593,470.1421, -2343.3291,-1816.8014,434.2834, 10);
              PlayerInfo[i][pUtrka1] = 2;
}
}
}
}


I evo nastavak dodavanja, cp-ova.....Ali nisam do kraja sve postavio, samo nekoliko da vidim oce to uopce raditi, i ispostavilo se da ne radi....
    if(PlayerInfo[playerid][pUtrka1] >= 2)
{
if(PlayerToPoint(5, playerid,-2279.8643,-1728.5593,470.1421))//cp1
{
if(PlayerInfo[playerid][pUtrka1] == 2)
{
PlayerInfo[playerid][pUtrka1] = 3;
                SetPlayerRaceCheckpoint(playerid, 0, -2343.3291,-1816.8014,434.2834, -2426.4685,-1738.7672,434.1338, 10);// kao sto vidite u race cp unosite iduci cp i onaj iza njega
}
        }
        if(PlayerToPoint(10, playerid,-2343.3291,-1816.8014,434.2834))//cp2
        {
        if(PlayerInfo[playerid][pUtrka1] == 3)
        {
PlayerInfo[playerid][pUtrka1] = 4;
                SetPlayerRaceCheckpoint(playerid, 0, -2426.4685,-1738.7672,434.1338, -2441.1936,-1785.4551,414.7432, 10);
}
}
}


Hvala unaprijed


Imam isti problem, a nzm kako rjesiti, zna li neko mozda?

Citat: Moonwalker poslato Novembar 09, 2010, 15:24:54 POSLE PODNE
Citat: Moonwalker poslato Novembar 08, 2010, 19:02:08 POSLE PODNE
Ljudi, trebam malu pomoc.
Naime radio sam race prema ovom tutu, i dodavao, CP-ove, i krene utrka i sve, prvi cp pokaze, i kad dodjem na taj cp, nece uopce da dalje nastavi pokazivat cp-ove. nzm u cem je problem.

Evo code kako sam radio, pa ak netko zna...

public UtrkaTimer4()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
    if(PlayerInfo[i][pUtrka1] == 1)
    {
              GameTextForPlayer(i, "2",1000,6);
              SetTimer("UtrkaTimer5",1000,0);
}
}
}
}
public UtrkaTimer5()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
    if(PlayerInfo[i][pUtrka1] == 1)
    {
              GameTextForPlayer(i, "1",1000,6);
              SetTimer("UtrkaTimer6",1000,0);
}
}
}
}
public UtrkaTimer6()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
    if(PlayerInfo[i][pUtrka1] == 1)
    {
              GameTextForPlayer(i, "START !!!",1000,6);
              SetPlayerRaceCheckpoint(i, 0, -2279.8643,-1728.5593,470.1421, -2343.3291,-1816.8014,434.2834, 10);
              PlayerInfo[i][pUtrka1] = 2;
}
}
}
}


I evo nastavak dodavanja, cp-ova.....Ali nisam do kraja sve postavio, samo nekoliko da vidim oce to uopce raditi, i ispostavilo se da ne radi....
    if(PlayerInfo[playerid][pUtrka1] >= 2)
{
if(PlayerToPoint(5, playerid,-2279.8643,-1728.5593,470.1421))//cp1
{
if(PlayerInfo[playerid][pUtrka1] == 2)
{
PlayerInfo[playerid][pUtrka1] = 3;
                SetPlayerRaceCheckpoint(playerid, 0, -2343.3291,-1816.8014,434.2834, -2426.4685,-1738.7672,434.1338, 10);// kao sto vidite u race cp unosite iduci cp i onaj iza njega
}
        }
        if(PlayerToPoint(10, playerid,-2343.3291,-1816.8014,434.2834))//cp2
        {
        if(PlayerInfo[playerid][pUtrka1] == 3)
        {
PlayerInfo[playerid][pUtrka1] = 4;
                SetPlayerRaceCheckpoint(playerid, 0, -2426.4685,-1738.7672,434.1338, -2441.1936,-1785.4551,414.7432, 10);
}
}
}


Hvala unaprijed


Imam isti problem, a nzm kako rjesiti, zna li neko mozda?
Umjesto SetPlayerRaceCheckpoint stavi SetPlayerCheckpoint ;)


Taj lik je to pitao prije GODINU DANA!!! I ti mu sada odgovaraš?! Ide ti zabrana pisanja na 24h


Moze neko pomoc, radio sam po ovom TuTu ali mi cp nece pokazat, dole na mapi mi pokazuje ali da crveno svijetli tamo u igri odnosno na cesti ne svijetli :S
Da li je moguce sto CPove nisam snimao u debug nego na svom kucnom serveru ?



Sergio_Don


ti si jedini vodje koji spamma, trazim pomoc i sam vidis ...
ako mi mozes pomoc, pomozi
a ako nemozes odjebi



Citat: Robyo97o poslato Maj 22, 2010, 20:04:02 POSLE PODNE
Citat: [BM]Alen_Sudec poslato Maj 21, 2010, 20:37:59 POSLE PODNE
Citat: SoaD123 poslato April 19, 2010, 16:46:36 POSLE PODNE
Evo kako sam ja to radio:
new drag[MAX_PLAYERS];
new dragrace;


pod forward:

forward UtrkaTimer();
forward UtrkaTimer2();
forward UtrkaTimer3();


dragrace = CreateObject(982, 2050.7309570313, -2493.9169921875, 13.230429649353, 0, 0, 0);

onplayercommand:
if(strcmp(cmd, "/dragracer", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
    tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Pisi: /dragracer [id igraca/Dio imena]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if (PlayerInfo[playerid][pAdmin] >= 1)
{
if(IsPlayerConnected(giveplayerid))
{
                    if(giveplayerid != INVALID_PLAYER_ID)
    {
    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "DragRace: %s, tebi je admin %s aktivirao utrku", giveplayer, sendername);
SendClientMessage(giveplayerid,COLOR_RED, string);
format(string, sizeof(string), "[DragRace]Igracu %s je utrku aktivirao admin %s", giveplayer, sendername);
SendAdminMessage(COLOR_GREEN, string);
                        SetPlayerRaceCheckpoint(giveplayerid, 1,1465.1482,-2493.8542,13.1253,0,0,0,20);
                        drag[giveplayerid] = 100;
}
}
}
else
{
format(string, sizeof(string), "   %d nije aktivan igrac.", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
return 1;
}
if(strcmp(cmd, "/startdragrace", true) == 0)
{
if (PlayerInfo[playerid][pAdmin] >= 1)
{
         GetPlayerName(playerid, sendername, sizeof(sendername));
             SendClientMessage(playerid, COLOR_GREEN, "Aktivirao si utrku");
             format(string, sizeof(string),"*Admin %s je aktivirao DragRace",sendername);
             SendAdminMessage(COLOR_RED,string);
         for(new i = 0; i < MAX_PLAYERS; i++)
         {
        if(IsPlayerConnected(i))
        {
                   if(drag[giveplayerid] == 100)
           {
                       SendClientMessage(i,COLOR_BLUE, "Utrka ce startati za 3 sekunde");
                       GameTextForPlayer(i, "3",1000,6);
                       SetTimer("UtrkaTimer",1000,0);
       }
        }
         }
}
return 1;
}


public OnPlayerEnterRaceCheckpoint(playerid);

new string[128];
new name[MAX_PLAYER_NAME];
if(drag[playerid] == 100){ DisablePlayerRaceCheckpoint(playerid);
SetPlayerRaceCheckpoint(playerid, 1,1465.1482,-2493.8542,13.1253,0,0,0,20);
drag[playerid] =101;}
else if(drag[playerid] == 101) {DisablePlayerRaceCheckpoint(playerid);
{
drag[playerid] = 0;
DisablePlayerRaceCheckpoint(playerid);
  GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "DragRace : %s je upravo zavrsio utrku ", name);
SendClientMessageToAll(COLOR_LIGHTRED, string);
}
}
return 1;
}


i na kraj skripte:

public UtrkaTimer()
{
    new giveplayerid;
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
     if(drag[giveplayerid] == 100)
    {
              GameTextForPlayer(i, "2",1000,6);
              SetTimer("UtrkaTimer2",1000,0);
}
}
}
}
public UtrkaTimer2()
{
    new giveplayerid;
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
     if(drag[giveplayerid] == 100)
    {
              GameTextForPlayer(i, "1",1000,6);
              SetTimer("UtrkaTimer3",1000,0);
}
}
}
}
public UtrkaTimer3()
{
    new giveplayerid;
    MoveObject(dragrace,2050.73046875,-2493.9169921875,11.190228462219, 4.0);//znaci kapija se automatski spusta kad timer kaze start
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
             if(drag[giveplayerid] == 100)
    {
              GameTextForPlayer(i, "START !!!",1000,6);
}
}
}
}

i tak je men, invitam se na utrku, aktivram utrku i dodem na prvi cp i nis
evo moj cod

public OnPlayerEnterCheckpoint(playerid)
{
    if(PlayerInfo[playerid][pUtrka] >= 2)
{
               if(PlayerToPoint(5.0, playerid, 1618.3621,-1725.6051,3.7159))//cp1
               {
                       if(PlayerInfo[playerid][pUtrka] == 3)
                       {
                            DisablePlayerRaceCheckpoint(playerid);
                            PlayerInfo[playerid][pUtrka] = 3;
                           
                            SetPlayerRaceCheckpoint(playerid, 0, 1630.9906,-1764.9762,3.7915, 1982.5056,-1849.8158,3.8735, 5.0);// kao sto vidite u race cp unosite iduci cp i onaj iza njega
   }
               }
               if(PlayerToPoint(5.0, playerid,1630.9906,-1764.9762,3.7915))//cp2
               {
                       if(PlayerInfo[playerid][pUtrka] == 3)
                       {
    DisablePlayerRaceCheckpoint(playerid);
                            PlayerInfo[playerid][pUtrka] = 4;
                           
                            SetPlayerRaceCheckpoint(playerid, 0, 1982.5056,-1849.8158,3.8735, 2416.0830,-1848.7604,1.2584, 5.0);
   }
               }
               if(PlayerToPoint(5.0, playerid,1982.5056,-1849.8158,3.8735))//cp2
               {
                       if(PlayerInfo[playerid][pUtrka] == 4)
                       {
    DisablePlayerRaceCheckpoint(playerid);
                            PlayerInfo[playerid][pUtrka] = 5;
                           
                            SetPlayerRaceCheckpoint(playerid, 0, 2416.0830,-1848.7604,1.2584, 2587.9768,-1595.2267,4.1636, 5.0);
   }
               }
               
               if(PlayerToPoint(5.0, playerid,2416.0830,-1848.7604,1.2584))//cp n-ti
               {
                       if(PlayerInfo[playerid][pUtrka] == 5)
                       {
                            SendClientMessage(playerid, COLOR_YELLOW, "Prosao si kroz cilj");
PlayerInfo[playerid][pUtrka] = 6;//da mozete i dalje vidjeti kad prolaze kroz cilj
                            DisablePlayerRaceCheckpoint(playerid);
//-------------------[Ovo je da svi oni koji su na raceu vide kad prodjete kroz cilj]
                            new string[128];
                        new sendername[MAX_PLAYER_NAME];
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        for(new i = 0; i < MAX_PLAYERS; i++)
                            {
           if(IsPlayerConnected(i))
           {
                                    if(PlayerInfo[i][pUtrka] > 0)
                {
                            format(string, sizeof(string), "|| = Phoenix Race: %s = ||",sendername);
                            SendClientMessage(i,COLOR_WHITE , string);
                }
           }
                             }

//-----------------------------------------------------------------------------
   }
               }
}

I timer jer ovo drugo nije tak vazno

public UtrkaTimer()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
    if(PlayerInfo[i][pUtrka] == 1)
    {
              GameTextForPlayer(i, "2",1000,6);
              SetTimer("UtrkaTimer2",1000,0);
}
}
}
}
public UtrkaTimer2()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
    if(PlayerInfo[i][pUtrka] == 1)
    {
              GameTextForPlayer(i, "1",1000,6);
              SetTimer("UtrkaTimer3",1000,0);
}
}
}
}
public UtrkaTimer3()
{
    MoveObject(utrkakapija,1617.6695556641, -1664.7639160156, 11.683554649353, 2.00);//znaci kapija se automatski spusta kad timer kaze start
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
    if(PlayerInfo[i][pUtrka] == 1)
    {
              GameTextForPlayer(i, "START !!!",1000,6);
              SetPlayerRaceCheckpoint(i, 0, 1618.3621,-1725.6051,3.7159, 1630.9906,-1764.9762,3.7915, 5.0);//cp 1
              PlayerInfo[i][pUtrka] = 2;
}
}
}
}

HELP

Oce li netko odgovoriti ovom decku xD
Imam isti problem :S

decki imam potpuno isti problem, dodem na prvi CP i nece ga izbrisat da mi se pokaze drugi a htio bi RACE cp-ove.... ako netko zna instalirati ovaj mod, zamolio bi ga neka mi se javi, stvarno trebam pomoc :) Hvala :DD

@ SoaD123 Mesas babe i zabe kod komande za prozivanje stavljas:


dragrace[giveplayerid] = 100;


a kod onplayerenterracecheckpoint trazis:


PlayerInfo[playerid][pUtrka]


Kako ocekujes da radi? :/

Stavi za proveru ili jedno ili drugo, ne mozes oba ... :)
Poslednja Izmena: Februar 13, 2012, 09:05:46 PRE PODNE od dock