01.08.2011, 03:16
The command:
I get no errors, but in game nothing happens, I made sure we were both logged in and connected, and I was on admin duty... Nothing happens no string no nothing... And the player doesn't get their skin set by the admin... Why is this? I get no errors...
pawn Код:
CMD:setskin(playerid, params[])
{
new Player, Skinid;
if (sscanf(params, "ui", Player, Skinid))
{
SendClientMessage(playerid, COLOR_GREY, "[Command Usage]: /setskin [PlayerID or Name] [SkinID]");
}
else if (Player == INVALID_PLAYER_ID)
{
SendClientMessage(playerid, COLOR_GREY, "Invalid player name or id entered!");
}
else
{
if(IsPlayerConnected(playerid) && IsPlayerConnected(Player))
{
if(gPlayerLogged[playerid] == 1)
{
if(PlayerInfo[playerid][pAdminLevel] > 0)
{
if(AdminDuty[playerid] == 1)
{
new playername[MAX_PLAYER_NAME], playername2[MAX_PLAYER_NAME], string[256], string2[256];
GetPlayerName(playerid, playername, sizeof(playername));
GetPlayerName(Player, playername2, sizeof(playername2));
format(string, sizeof(string), "Your skin has been set to %i by %s", Skinid, playername);
SendClientMessage(Player, COLOR_YELLOW, string);
format(string2, sizeof(string2), "You have set %s's skin to %i", playername2, Skinid);
SendClientMessage(playerid, COLOR_YELLOW, string2);
SetPlayerSkin(Player, Skinid);
PlayerInfo[Player][pSkin] = Skinid;
}
else
{
SendClientMessage(playerid, COLOR_GREY, "You must be on duty to perform this command");
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "You must be a moderator/administrator to perform this command");
}
}
}
}
return 1;
}