/Joinrace loop command [HELP] PLEAZZ! -
chubz - 10.07.2013
Heu Guys im trying to make a /joinrace command that when a player types the command it sends him to the race park in a car but i want to make a loop that if someone is already in one of the race cars it sends him to another one and if all 6 of them are taken by players it tells the player that the race is already full. I hope you understand me, and guys any help please would be Indorsed THANX

!!!
Re: /Joinrace loop command [HELP] PLEAZZ! -
Aerotactics - 10.07.2013
I'm gonna give it a shot, 1 sec
EDIT: It's not a loop, but it will get the job done.
pawn Код:
#include <a_samp>
//Start under ^^
new Rcar;
new Rcar2;
new Rcar3;
//Need to define the cars, so we can check to see if someone is in them
public OnGameModeInit()
{
Rcar=AddStaticVehicle(560,2485.6999500,-1667.9000200,13.1000000,0.0000000,32,79); //Sultan
Rcar2=AddStaticVehicle(560,2490.6999500,-1667.9000200,13.1000000,0.0000000,32,79); //Sultan
Rcar3=AddStaticVehicle(560,2495.6999500,-1667.9000200,13.1000000,0.0000000,32,79); //Sultan
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/joinrace", cmdtext, true, 10) == 0)
{
if (IsPlayerInVehicle(playerid, Rcar))
{
if (IsPlayerInVehicle(playerid, Rcar2))
{
if (IsPlayerInVehicle(playerid, Rcar3))
{
SendClientMessage(playerid, 0xFFFF00FF , "The Race is FULL.");
return 1;
}
else
{
PutPlayerInVehicle(playerid, Rcar3, 0);
return 1;
}
}
else
{
PutPlayerInVehicle(playerid, Rcar2, 0);
return 1;
}
}
else
{
PutPlayerInVehicle(playerid, Rcar, 0);
return 1;
}
}
return 0;
}
Re: /Joinrace loop command [HELP] PLEAZZ! -
Aerotactics - 10.07.2013
There^^ Sorry
Re: /Joinrace loop command [HELP] PLEAZZ! -
chubz - 10.07.2013
Thanx Bro ill Give it a Try!!
Re: /Joinrace loop command [HELP] PLEAZZ! -
Aerotactics - 10.07.2013
Quote:
Originally Posted by chubz
Thanx Bro ill Give it a Try!! 
|
Tell me how it went. Is that what you were looking for? I know it's only 3 cars there, so I could add on 3 more cars to it.
Re: /Joinrace loop command [HELP] PLEAZZ! -
chubz - 12.07.2013
Yh it didnt end up working every time someone typed in the command it would spawn three more cars on top of the others already there. Ill keep trying see what i can do.
Re: /Joinrace loop command [HELP] PLEAZZ! -
Aerotactics - 12.07.2013
Quote:
Originally Posted by chubz
Yh it didnt end up working every time someone typed in the command it would spawn three more cars on top of the others already there. Ill keep trying see what i can do.
|
That's probably because you put the car spawns inside the command itself. Put the car spawns under OnGameModeInIt and the command where the commands go lol
Re: /Joinrace loop command [HELP] PLEAZZ! -
chubz - 19.07.2013
Nah Thats not it i have the cars under gamemode not in the actual command!