16.07.2012, 15:10
Whenever I type /gteam X all it tells me is X (ID: X) is . And it always says the team is . no matter in which team X is in.
pawn Код:
new TeamsNames[16][13] = {{"None"},{"Medic"},{"Cop"},{"Fireman"},{"Solider"},{"Rich"},{"Mafia"},{"Hobo"},{"Hotel Worker"},{"Clown"},{"Chicken"},{"Farmer"},{"Grove"},{"Ballas"},{"Vagos"},{"Various"}};
if(strcmp(cmd, "/getteam", true) == 0) {
new tmp[256],pteam;
pid = strval(tmp);
tmp = strtok(cmdtext,idx);
if(!strlen(tmp)) return SendClientMessage(playerid,0xffffffff,"USAGE: /getteam [playerid]");
if(IsPlayerConnected(pid)) {
GetPlayerName(playerid,sp,sizeof(sp));
pteam = GetPlayergTeam(pid);
format(str,128 char,"%s (ID:%d) team is: %s.",sp,pid,pteam);
SendClientMessage(playerid,0xffffff00,str); }
else return SendClientMessage(playerid,0xffffff00,"Warning: Player is not connected!");
return 1; }
stock GetPlayergTeam(playerid)
{
new TeamN;
new skin = GetPlayerSkin(playerid);
if(GetPlayerVirtualWorld(playerid)) return -1;
switch(skin) {
case 274..276: gTeam{playerid} = TEAM_Medic,TeamN = TeamsNames[1][5];
case 280..284,265..267: gTeam{playerid} = TEAM_Cop,TeamN = TeamsNames[2][3];
case 277..279: gTeam{playerid} = TEAM_Fireman,TeamN = TeamsNames[3][7];
case 287: gTeam{playerid} = TEAM_Solider,TeamN = TeamsNames[4][7];
case 12,40,46,50,59,223,226: gTeam{playerid} = TEAM_Rich,TeamN = TeamsNames[5][4];
case 124..127: gTeam{playerid} = TEAM_Mafia,TeamN = TeamsNames[6][5];
case 230,239: gTeam{playerid} = TEAM_Hobo,TeamN = TeamsNames[7][4];
case 11,171..172,189,194: gTeam{playerid} = TEAM_HotelWorker,TeamN = TeamsNames[8][12];
case 167: gTeam{playerid} = TEAM_Chicken,TeamN = TeamsNames[9][7];
case 174: gTeam{playerid} = TEAM_Clown,TeamN = TeamsNames[10][5];
case 24,32,129,133,162,196,197: gTeam{playerid} = TEAM_Farmer,TeamN = TeamsNames[11][6];
case 105..107,269..271: gTeam{playerid} = TEAM_Grove,TeamN = TeamsNames[12][5];
case 102..104: gTeam{playerid} = TEAM_Ballas,TeamN = TeamsNames[13][6];
case 108..110: gTeam{playerid} = TEAM_Vagos,TeamN = TeamsNames[14][5];
case 114..116: gTeam{playerid} = TEAM_Various,TeamN = TeamsNames[15][7]; }
return TeamN; }