race question - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: race question (
/showthread.php?tid=77182)
race question -
Gamer007 - 09.05.2009
when a guy like writes /race it would spawn it to the position ( I did the position ) but how to do to spawn him in a CAR that IS NOT USED BY ANOTHER GUY( imean who is not sitting in it, its empty) can someone write a code or tell me how to do it
Re: race question -
GanG$Ta - 09.05.2009
/race command:
new Float:Pos[4];
//Your SpawnPostion
GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
GetPlayerFacingAngle(playerid,Pos[3]);
new VehiclE = CreateVehicle(vehicletype,Pos[0],Pos[1],Pos[2],Pos[3],-1,-1,respawn_delay);
PutPlayerInVehicle(playerid,VehiclE, 0);
Re: race question -
Gamer007 - 09.05.2009
this code won't work it justs puts a player in a vehicle but it doesn't check if its empty... thats the problem :S
Re: race question -
Think - 09.05.2009
Quote:
Originally Posted by Gamer007
this code won't work it justs puts a player in a vehicle but it doesn't check if its empty... thats the problem :S
|
the car IS empty because you just spawned it.
Re: race question -
Gamer007 - 09.05.2009
well yeah... i'm trying figure out a code that cars are spawned and then when guy is entering a car it would respawn so it would be 100% empty.. but the thing is what about the other guys? example its a 4 men race and they just spawn in not empty cars and throw out the guys who were sitting in it(it enters them randomly to a car right?), i would need somehow a code that reaches a player limit to the race example only 4 allowed to race and others can't get in when the race is full but i don't think thats possible or is it? (the thing is i didn't script few months and i can't combine the commands that good now, so i am asking for help)
Re: race question -
GanG$Ta - 09.05.2009
In the Race Command:
Код:
new PlayerLimitRace;
PlayerLimitRace++;
if(PlayerLimitRace < 5)
{
// players can race
//set the pos and other stuff
}
else if(PlayerLimitRace > 4) return SendClientMessage(playerid,COLOR,"Max Player Limit is 4");
and when the race is finished reset PlayerLimitRace to zero.