race question
#1

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
Reply
#2

/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);

Reply
#3

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
Reply
#4

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.
Reply
#5

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)
Reply
#6

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)