public OnPlayerSpawn(playerid)
{
if(gTeam[playerid] == TEAM_COP)
{
SetPlayerColor(playerid, COLOR_BLUE);
}
else if(gTeam[playerid] == TEAM_CRIMINAL)
{
SetPlayerColor(playerid, COLOR_RED);
}
return 1;
}
add under onPlayerSpawn add SetPlayerColor(playerid,Color); under each team with the color of course
![]() |
new Float:gRandomPlayerSpawns[23][3] = {
{2493.0972,-1666.5704,13.3438}
};
new Float:gCopPlayerSpawns[2][3] = {
{2533.7241,2092.1035,10.8203}
};
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);
}
else if (iSpawnSet[playerid] == 0)
{
new rand = random(sizeof(gRandomPlayerSpawns));
SetPlayerPos(playerid, gRandomPlayerSpawns[rand][0], gRandomPlayerSpawns[rand][1], gRandomPlayerSpawns[rand][2]); // Warp the player
}
return 1;
}
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;
}
try this
![]() pawn Код:
|
new Float:gRandomPlayerSpawns[23][3] = {
{2493.0972,-1666.5704,13.3438},//remember to put ',' in the end of the line if you want to add more cords/lines like this
{0.00,0.00,0.00}//and add more like this if you want more...(change 0.00 to your cordinate
};
new Float:gCopPlayerSpawns[2][3] = {
{2533.7241,2092.1035,10.8203}//the same here
};