Race Create
#1

oh well am serching millions times and cant find it how can i cretae race
i have Cp streamer thats why i can create many races but i want to learn ho e to create one

what commands,etc.i ned to create a race from CP with race,timer etc.

Can someone realy help or give pastebin code or something lse
I am tired of seraching beceuse nowhere anybody can tell
Always others just says iofftopiic and thats all
Answer only these who can help

Thankyou
Reply
#2

joinning the Q
Reply
#3

Quote:
Originally Posted by Warriors_Tornado
oh well am serching millions times and cant find it how can i cretae race
i have Cp streamer thats why i can create many races but i want to learn ho e to create one

what commands,etc.i ned to create a race from CP with race,timer etc.

Can someone realy help or give pastebin code or something lse
I am tired of seraching beceuse nowhere anybody can tell
Always others just says iofftopiic and thats all
Answer only these who can help

Thankyou
Where can i find a CP Creator..??
Reply
#4

[Joining question]
Reply
#5

I don't know how i can do, but i can think logically:

like.. Create an Array with the co-ordinates the CP's gonna be:
pawn Код:
new Status[MAX_PLAYERS];
new CheckPoints[4][3] = //4 = 4 slots | 3 = 3 "values" (X,Y,Z)
{
     {X,Y,Z},
     {X,Y,Z},
     {X,Y,Z},
     {X,Y,Z}
};
Then start the race..
pawn Код:
if(strcmp(cmdtext, "/start", true) == 0)
{
     if(IsPlayerAdmin(playerid))
     {
         for(new i = 0; i < GetMaxPlayers(); i++)
         {
              if(IsPlayerConnected(i)) //to every1 in teh server
              {            //0 = normal-------1 = slot 1 | 1 = X---
                  SetPlayerRaceCheckpoint(i, 0, Checkpoints[1][1], Checkpoints[1][2], Checkpoints[1][3], Checkpoints[2][1], Checkpoints[2][2], Checkpoints[2][3], 10);//10 maybe??
                  Statur[i] = 1;
                  return 1;
              }
         }
     }
     else
     {
         SendClientMessage(playerid, COLOR_RED, "Only for admin's");
     }
}
Then when entering CP:
pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
     switch(Status[playerid])
     {
         case 1:
         {
              DisablePlayerRaceCheckpoint(playerid);
              SetPlayerRaceCheckpoint(playerid, 0, Checkpoints[2][1], Checkpoints[2][2], Checkpoints[2][3], Checkpoints[3][1], Checkpoints[3][2], Checkpoints[3][3], 10);
              Status[i] = 2;
              return 1;
         }
         case 2:
         {
              DisablePlayerRaceCheckpoint(playerid);
              SetPlayerRaceCheckpoint(playerid, 0, Checkpoints[3][1], Checkpoints[3][2], Checkpoints[3][3], Checkpoints[4][1], Checkpoints[4][2], Checkpoints[4][3], 10);
              Status[i] = 3;
              return 1;
         }
         case 3:
         {
              DisablePlayerRaceCheckpoint(playerid);
              SetPlayerRaceCheckpoint(playerid, 1, Checkpoints[4][1], Checkpoints[4][2], Checkpoints[4][3], Checkpoints[4][1], Checkpoints[4][2], Checkpoints[4][3]-5, 10); //so it looks down
              Status[i] = 4;
              return 1;
         }
         case 4:
         {
              DisablePlayerRaceCheckpoint(playerid);
              GameTextForPlayer(playerid, "You have won the race!!", 3000, 1);
              GivePlayerMoney(playerid, 10000);
              return 1;
         }
     }
}
Sorry if this is noobish but i try as hard as i can
hope this helps
Reply
#6

galera,tentei fazer o sistema de corrida e nгo deu muito certo... minhas dъvidas estгo neste tуpico :

http://forum.sa-mp.com/index.php?topic=179666

peзo que me ajudem,obrigado...

MSN : suporte@brasilplaygames.com.br

Skype : rodrigovilhenabr
Reply
#7

Para de falar notra lingua do que ingles.
A um forum para outras linguas mais im baixo. >.>
Reply
#8

pawn Код:
//Wherever you want to start the race
SetPlayerRaceCheckpoint(i, 0, 0.0, 0.0, 0.0, 5.0, 5.0, 5.0, 20.0);
SetPVarInt(playerid, "Race", 1);
pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
  switch(GetPVarInt(playerid, "Race"))
  {
    case 1:
    {
      DisablePlayerRaceCheckpoint(playerid);
      switch(GetPVarInt(playerid, "Status"))
      { //Sure you could do that with an array as well but I dont like to waste memory
        case 0: SetPlayerRaceCheckpoint(playerid, 0,    5.0,    5.0,    5.0,    10.0,   10.0,   10.0,   20.0);
        case 1: SetPlayerRaceCheckpoint(playerid, 0,    10.0,   10.0,   10.0,   -3.0,   -3.0,   -3.0,   20.0);
        case 2: SetPlayerRaceCheckpoint(playerid, 0,    -3.0,   -3.0,   -3.0,   2.0,    2.0,    2.0,    20.0);
        case 3: SetPlayerRaceCheckpoint(playerid, 1,    2.0,    2.0,    2.0,    0.0,    0.0,    0.0,    20.0);
        case 4:
        {
          new string[64];
          static Ranks;
          GetPlayerName(playerid, string, MAX_PLAYER_NAME);
          switch(++Rank)
          {
            case 1: format(string, sizeof string, "~r~%s ~b~won the race (race1)", string);
            case 2: format(string, sizeof string, "~r~%s ~b~is second (race1)", string);
            case 3: format(string, sizeof string, "~r~%s ~b~is third (race1)", string);
          }
          DeletePVar(playerid, "Race");
          DeletePVar(playerid, "Status");
          SendClientMessageToAll(0xFF0000AA, string);
          return GivePlayerMoney(playerid, Rank * 5000);
        }
      }
      return SetPVarInt(playerid, "Status", GetPVarInt(playerid, "Status") + 1);
    }
  }
}
Reply
#9

I'll make a tutorial on this in a few hours . Watch out for the topic.
Reply
#10

pspleo - with your tut scripters will have errors because array indexes start with zero - x[0],y[1],z[2]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)