27.03.2011, 08:28
This code is better btw.
pawn Код:
COMMAND:setteam(playerid, params[])
{
new id, pTeam, string[64], name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
if(PlayerInfo[playerid][AdminLevel] >= 106)
{
if(sscanf(params, "ud", id, pTeam)) return SendClientMessage(playerid, -1, "USAGE: /setteam [PlayerId/PartOfName] [Team]");
if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "Player Not Found");
if(pTeam > 5) return SendClientMessage(playerid, -1,"ERROR: Invalid Team, Avaliable Teams: 1, 2, 3, 4, 5");
GetPlayerName(playerid, name, sizeof(name));
GetPlayerName(id, PlayerName, sizeof(PlayerName));
format(string, sizeof(string), "%s Has Make You Member Of Team %d .", name, pTeam);
SendClientMessage(id, -1, string);
format(string, sizeof(string), "You Gave %d Team Member %s .", pTeam, PlayerName);
SendClientMessage(playerid, -1, string);
PlayerInfo[id][Team] = pTeam;
}
else return SendClientMessage(playerid, -1, "You are not allowed to use this command.");
return 1;
}