27.01.2019, 20:21
Quote:
Hello ! Help me with the code! How do i make rondomny spawn both in Cops and Robbers ? That is, the police spvnitsa only on the site, doctors at the hospital and so on! What do I need to register in a public OnPlayerSpawn (playerid)
|
pawn Code:
new rand = random(sizeof(CivilianSpawn));
SetPlayerPos(playerid, CivilianSpawn[rand][0], CivilianSpawn[rand][1],CivilianSpawn[rand][2]);
SetPlayerFacingAngle(playerid, CivilianSpawn[rand][3]);
pawn Code:
if(gTeam[playerid] == TEAM_COP]
{
new rand = random(sizeof(CopSpawn));
SetPlayerPos(playerid, CopSpawn[rand][0], CopSpawn[rand][1],CopSpawn[rand][2]);
SetPlayerFacingAngle(playerid, CopSpawn[rand][3]);
}