pawn Код:
public SetPlayerSpawn(playerid)
{ if(pdebug == 1){printf("[DEBUG] SetPlayerSpawn(%d)", playerid);}
IsPlayerInHouse[playerid] = INVALID_HOUSE_ID;
if(PlayerInfo[playerid][pJailedSec] > 0)
{
OnPlayerJailed(playerid);
return 1;
}
if(PlayerInfo[playerid][pHouseKey] != INVALID_HOUSE_ID)
{
new houseid = PlayerInfo[playerid][pHouseKey];
SetPlayerPos(playerid, HouseInfo[houseid][hExitx], HouseInfo[houseid][hExity], HouseInfo[houseid][hExitz]);
SetPlayerInterior(playerid, HouseInfo[houseid][hInt]);
SetPlayerVirtualWorld(playerid, HouseInfo[houseid][hWorld]);
IsPlayerInHouse[playerid] = houseid;
SetPlayerTeamColor(playerid);
return 1;
}
/*
if(PlayerInfo[playerid][pPosX] != RandomPlayerSpawns[0][0] && PlayerInfo[playerid][pPosY] != RandomPlayerSpawns[0][1] && PlayerInfo[playerid][pPosZ] != RandomPlayerSpawns[0][2])
{
SetPlayerPos(playerid, PlayerInfo[playerid][pPosX], PlayerInfo[playerid][pPosY], PlayerInfo[playerid][pPosZ]);
SetPlayerInterior(playerid, PlayerInfo[playerid][pInt]);
SetPlayerVirtualWorld(playerid, PlayerInfo[playerid][pVir]);
return 1;
}
*/
if(gTeam[playerid] == TEAM_ARMY)
{
if(PlayerInfo[playerid][pRank] == 2)
{
new rand = random(sizeof(RandomArmySpawns));
SetPlayerPos(playerid, RandomArmySpawns[rand][0], RandomArmySpawns[rand][1], RandomArmySpawns[rand][2]);
SetPlayerFacingAngle(playerid, RandomArmySpawns[rand][3]);
SetPlayerInterior(playerid, armint);
SetPlayerVirtualWorld(playerid, armvir);
SetPlayerTeamColor(playerid);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_RED, "You are not allowed to be a soldier, go to our site | topic: army recruiting.");
gTeam[playerid] = TEAM_NORMAL;
PlayerInfo[playerid][pTeam] = gTeam[playerid];
PlayerInfo[playerid][pSkin] = Skins[0][0];
SetPlayerSkin(playerid, Skins[0][0]);
SetPlayerSpawn(playerid);
SetPlayerColor(playerid, TEAMCOLOR_NORMAL);
return 1;
}
}
if(gTeam[playerid] == TEAM_COP)
{
if(PlayerInfo[playerid][pRank] == 1)
{
new rand = random(sizeof(RandomCopsSpawns));
SetPlayerPos(playerid, RandomCopsSpawns[rand][0], RandomCopsSpawns[rand][1], RandomCopsSpawns[rand][2]);
SetPlayerFacingAngle(playerid, RandomCopsSpawns[rand][3]);
SetPlayerInterior(playerid, copint);
SetPlayerVirtualWorld(playerid, copvir);
SetPlayerTeamColor(playerid);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_BLUE, "You are not allowed to be a cop, go to our site | topic: cop recruiting.");
gTeam[playerid] = TEAM_NORMAL;
PlayerInfo[playerid][pTeam] = gTeam[playerid];
PlayerInfo[playerid][pSkin] = Skins[0][0];
SetPlayerSkin(playerid, Skins[0][0]);
SetPlayerSpawn(playerid);
SetPlayerColor(playerid, TEAMCOLOR_NORMAL);
return 1;
}
}
if(gTeam[playerid] == TEAM_MEDIC)
{
new rand = random(sizeof(RandomMedicSpawns));
SetPlayerPos(playerid, RandomMedicSpawns[rand][0], RandomMedicSpawns[rand][1], RandomMedicSpawns[rand][2]);
SetPlayerFacingAngle(playerid, RandomMedicSpawns[rand][3]);
SetPlayerInterior(playerid, medint);
SetPlayerVirtualWorld(playerid, medvir);
SetPlayerTeamColor(playerid);
return 1;
}
if(gTeam[playerid] == TEAM_NEWS)
{
new rand = random(sizeof(RandomNewsrSpawns));
SetPlayerPos(playerid, RandomNewsrSpawns[rand][0], RandomNewsrSpawns[rand][1], RandomNewsrSpawns[rand][2]);
SetPlayerFacingAngle(playerid, RandomNewsrSpawns[rand][3]);
SetPlayerInterior(playerid, newsrint);
SetPlayerVirtualWorld(playerid, newsrvir);
SetPlayerTeamColor(playerid);
return 1;
}
if(gTeam[playerid] == TEAM_FIREMAN)
{
new rand = random(sizeof(RandomFiremanSpawns));
SetPlayerPos(playerid, RandomFiremanSpawns[rand][0], RandomFiremanSpawns[rand][1], RandomFiremanSpawns[rand][2]);
SetPlayerFacingAngle(playerid, RandomFiremanSpawns[rand][3]);
SetPlayerInterior(playerid, firint);
SetPlayerVirtualWorld(playerid, firvir);
SetPlayerTeamColor(playerid);
return 1;
}
else
{
new rand = random(sizeof(RandomPlayerSpawns));
SetPlayerPos(playerid, RandomPlayerSpawns[rand][0], RandomPlayerSpawns[rand][1], RandomPlayerSpawns[rand][2]);
SetPlayerFacingAngle(playerid, RandomPlayerSpawns[rand][3]);
SetPlayerInterior(playerid, norint);
SetPlayerVirtualWorld(playerid, norvir);
SetPlayerTeamColor(playerid);
}
return 1;
}