pawn Код:
if(strcmp(cmd, "/getteam", true) == 0)
{
new tmp[256];
pid = strval(tmp);
tmp = strtok(cmdtext,idx);
if(!strlen(tmp)) return SendClientMessage(playerid, -1, "USAGE: /getteam [playerid]");
if(!IsPlayerConnected(pid)) return SendClientMessage(playerid, 0xFFFFFF00, "Warning: Player is not connected!");
GetPlayerName(playerid,sp,sizeof(sp));
format(str,128,"%s (ID:%d) team is: %s.", sp, pid, GetPlayergTeam(pid));
SendClientMessage(playerid,0xFFFFFF00,str);
return 1;
}
stock GetPlayergTeam(playerid)
{
new TeamN[64];
new skin = ;
//if(GetPlayerVirtualWorld(playerid) == ?) return -1;
switch(GetPlayerSkin(playerid))
{
case 274..276: gTeam{playerid} = TEAM_Medic,TeamN = TeamsNames[1];
case 280..284,265..267: gTeam{playerid} = TEAM_Cop,TeamN = TeamsNames[2];
case 277..279: gTeam{playerid} = TEAM_Fireman,TeamN = TeamsNames[3];
case 287: gTeam{playerid} = TEAM_Solider,TeamN = TeamsNames[4];
case 12,40,46,50,59,223,226: gTeam{playerid} = TEAM_Rich,TeamN = TeamsNames[5];
case 124..127: gTeam{playerid} = TEAM_Mafia,TeamN = TeamsNames[6];
case 230,239: gTeam{playerid} = TEAM_Hobo,TeamN = TeamsNames[7];
case 11,171..172,189,194: gTeam{playerid} = TEAM_HotelWorker,TeamN = TeamsNames[8];
case 167: gTeam{playerid} = TEAM_Chicken,TeamN = TeamsNames[9];
case 174: gTeam{playerid} = TEAM_Clown,TeamN = TeamsNames[10];
case 24,32,129,133,162,196,197: gTeam{playerid} = TEAM_Farmer,TeamN = TeamsNames[11];
case 105..107,269..271: gTeam{playerid} = TEAM_Grove,TeamN = TeamsNames[12];
case 102..104: gTeam{playerid} = TEAM_Ballas,TeamN = TeamsNames[13];
case 108..110: gTeam{playerid} = TEAM_Vagos,TeamN = TeamsNames[14];
case 114..116: gTeam{playerid} = TEAM_Various,TeamN = TeamsNames[15];
}
return TeamN;
}