13.05.2011, 21:12
try this
pawn Код:
public OnPlayerSpawn(playerid)
{
GivePlayerMoney(playerid, PocketMoney);
SetPlayerInterior(playerid,0);
SetPlayerRandomSpawn(playerid);
TogglePlayerClock(playerid,1);
TextDrawShowForPlayer(playerid,Textdraw2);
TextDrawShowForPlayer(playerid,Textdraw3);
return 1;
}
public SetPlayerRandomSpawn(playerid)
{
if (iSpawnSet[playerid] == 1)
{
new rand = random(sizeof(gCopPlayerSpawns));
SetPlayerPos(playerid, gCopPlayerSpawns[rand][0], gCopPlayerSpawns[rand][1], gCopPlayerSpawns[rand][2]); // Warp the player
SetPlayerFacingAngle(playerid, 270.0);
SetPlayerColor(playerid, COLOR_BLUE);
}
else if (iSpawnSet[playerid] == 0)
{
new rand = random(sizeof(gRandomPlayerSpawns));
SetPlayerPos(playerid, gRandomPlayerSpawns[rand][0], gRandomPlayerSpawns[rand][1], gRandomPlayerSpawns[rand][2]); // Warp the player
SetPlayerColor(playerid,COLOR_RED);
}
return 1;
}