Vehicle
#1

So i want to make derby map. I have map but also i have problem. I want when player trype /derby to join on random coords on map and to be putted in veh. I did this but it doesn't work.
Код:
CMD:derby(playerid, params[])
{
	PlayerJoinedDerby[playerid] = 1;
	new randomcoords = random(sizeof(DBSpawn));
	SPP(playerid, DBSpawn[randomcoords][0], DBSpawn[randomcoords][1], DBSpawn[randomcoords][2]);
	PutPlayerInVehicle(playerid, veh, 0);
	LoadObjectsForPlayer(playerid);
	return 1;
}
Any ideas?? I am confused because it would be easy with only 1 spawn place. I want random
Reply
#2

CMD:derby(playerid, params[])
{
PlayerJoinedDerby[playerid] = 1;
new RandomTP = Random(3);//Defines the variable into how many randoms(teleports u want)
switch(RandomTP)//tells server to make the next lot of case's to be selected at random
{
case 0: SetPlayerPos(playerid,derby pos1 cordinates);
case 1: SetPlayerPos(playerid,derby pos2 cordinates);
case 2: SetPlayerPos(playerid,derby pos3 cordinates);
}
CarSpawner(playerid,vehicle);
LoadObjectsForPlayer(playerid);
return 1;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)