31.01.2011, 23:34
Maybe this will give you something to work with? Not sure if it really help
pawn Код:
public OnPlayerRequestSpawn(playerid)
{
if(!IsPlayerNPC(playerid))
{
if(!PlayerInfo[playerid][Logged]) { SendClientMessage(playerid, COLOR_ERROR, "ERROR: You must login/register before spawning!"); return 0; }
else if(PlayerInfo[playerid][c]==3 && PlayerInfo[playerid][NationalGuard]==0) { SendClientMessage(playerid, COLOR_ERROR, "ERROR: You need to be invited into National Guard before spawning into it."); return 0; }
else if(PlayerInfo[playerid][c]==2 && PlayerInfo[playerid][Swat]==0) { SendClientMessage(playerid, COLOR_ERROR, "ERROR: You need to be invited into S.W.A.T before spawning into it."); return 0; }
else
{
PlayerInfo[playerid][Team] = PlayerInfo[playerid][c];
switch(PlayerInfo[playerid][Team])
{
case 0,1: //police + cia
{
SetPlayerColor(playerid, COLOR_BLUE);
if(PlayerInfo[playerid][Team] == 1) SetPlayerColor(playerid, COLOR_WHITE);
SetPlayerTeam(playerid, TEAM_POLICE);
//SetSpawnInfo(playerid, GetPlayerSkin(playerid), TEAM_POLICE, 1526.1906,-1677.9984,5.8906,267.8484, 24, 200, 29, 150, 25, 20);
SetPlayerPos(playerid, 1526.1906,-1677.9984,5.8906);
GivePlayerWeapon(playerid, 24, 200); GivePlayerWeapon(playerid, 29, 150); GivePlayerWeapon(playerid, 25, 200);
}
case 2: //swat
{
SetPlayerColor(playerid, COLOR_LIGHTBLUE);
SetPlayerTeam(playerid, TEAM_POLICE);
//SetSpawnInfo(playerid, GetPlayerSkin(playerid), TEAM_POLICE, 759.4473,-1363.1069,13.5181,265.0181, 24, 200, 31, 250, 27, 50);
SetPlayerPos(playerid, 759.4473,-1363.1069,13.5181);
GivePlayerWeapon(playerid, 24, 200); GivePlayerWeapon(playerid, 31, 250); GivePlayerWeapon(playerid, 27, 50);
}
case 3: //national guard
{
SetPlayerColor(playerid, COLOR_PURPLE);
SetPlayerTeam(playerid, TEAM_POLICE);
//SetSpawnInfo(playerid, GetPlayerSkin(playerid), TEAM_POLICE, 2749.4026,-2447.4622,13.6484,357.4269, 29, 200, 31, 250, 27, 80);
SetPlayerPos(playerid, 2749.4026,-2447.4622,13.6484);
GivePlayerWeapon(playerid, 29, 200); GivePlayerWeapon(playerid, 31, 250); GivePlayerWeapon(playerid, 27, 80);
}
case 4: //ems / fd
{
SetPlayerColor(playerid, COLOR_DARKGREEN);
SetPlayerTeam(playerid, TEAM_POLICE);
//SetSpawnInfo(playerid, GetPlayerSkin(playerid), TEAM_POLICE, 1185.4379,-1323.6609,13.5721,262.1728, 23, 200, 0, 0, 0, 0);
SetPlayerPos(playerid, 1185.4379,-1323.6609,13.5721);
GivePlayerWeapon(playerid, 23, 200);
}
case 5: //civ
{
SetPlayerColor(playerid, COLOR_WHITE);
SetPlayerTeam(playerid, playerid+10);
}
}
}
}
return 1;
}