22.02.2009, 13:18
Hey guys, i got a little problem.
i'm scripting at the moment on a derby and i can't go on, because when the players are spawning they should spawn at different spots and noone should have the same, but they spawn all exactly at the same place.
My Codes:
/derby:
Menu:
DerbyGo:
OnPlayerSpawn:
till now it's like this: if i spawn every player is given the variable driveschool == 1.
i know why, cause every playerid gets ++ (+1).
How can i do it that every player gets one different spot doesn't depending on how much players?
i'm scripting at the moment on a derby and i can't go on, because when the players are spawning they should spawn at different spots and noone should have the same, but they spawn all exactly at the same place.
My Codes:
/derby:
pawn Код:
if(strcmp(cmdtext, "/derby",true)==0)
{
GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
format(string, sizeof(string), "%s is going to Derby!", playername);
SendClientMessageToAll(blue,string);
if(derbytime == 0)
{
ShowMenuForPlayer(derbymenu,playerid);
derbycheck[playerid]++;
SetPlayerCameraPos(playerid,-2072.1663,-121.7532,35.3296);
SetPlayerCameraLookAt(playerid,-2072.1663,-121.7532,35.3296);
TogglePlayerControllable(playerid,0);
SetTimerEx("DerbyGo",7000,false,"i",playerid);
}
return 1;
}
pawn Код:
if (Current == derbymenu)
{
switch(row)
{
case 0:
{
new string[256];
if(derbycheck[playerid] > 0)
{
driveschool[playerid]++;
GetPlayerName(playerid, playername, sizeof(playername));
format(string, sizeof(string), "%s select SF Driveschool", playername);
SendClientMessageToAll(gelb,string);
return 1;
}
}
pawn Код:
forward DerbyGo(playerid);
public DerbyGo(playerid)
{
if(derbycheck[playerid] > 0)
{
SpawnPlayer(playerid);
}
}
pawn Код:
if(derbycheck[playerid] > 0)
{
if(driveschool[playerid] == 1)
{
new vid = CreateVehicle(504,-2058.2822,-107.3824,35.3203,180.00,0,0,60);
PutPlayerInVehicle(playerid, vid, 0);
LinkVehicleToInterior(vid, GetPlayerInterior(playerid));
VehiclesToDestroy[vid] = 1;
ResetPlayerWeapons(playerid);
return 1;
}
if(driveschool[playerid] == 2)
{
new vid = CreateVehicle(504,-2068.8708,-107.0806,35.3225,180.00,0,0,60);
PutPlayerInVehicle(playerid, vid, 0);
LinkVehicleToInterior(vid, GetPlayerInterior(playerid));
VehiclesToDestroy[vid] = 1;
ResetPlayerWeapons(playerid);
return 1;
}
if(driveschool[playerid] == 3)
{
new vid = CreateVehicle(504,-2078.1958,-107.0035,35.3203,180.00,0,0,60);
PutPlayerInVehicle(playerid, vid, 0);
LinkVehicleToInterior(vid, GetPlayerInterior(playerid));
VehiclesToDestroy[vid] = 1;
ResetPlayerWeapons(playerid);
return 1;
}
}
till now it's like this: if i spawn every player is given the variable driveschool == 1.
i know why, cause every playerid gets ++ (+1).
How can i do it that every player gets one different spot doesn't depending on how much players?