Help /setskin
#6

Also you could do with an overall improvement of code.

pawn Код:
COMMAND:setskin(playerid, params[])
{
    if(AccountInfo[playerid][aLevel] < 1) SendClientMessage(playerid, COLOR_RED, "AdminLevel 1 needed for this command!");
    else
    {
        new ID, skin;
        if(sscanf(params, "ud", ID, skin)) SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /setskin [id] [skinid]");
        else
        {
            if(ID == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_YELLOW,"ERROR: Player not found");
            if(!IsValidSkin(skin)) return SendClientMessage(playerid, COLOR_YELLOW, "ERROR: Invaild Skin ID");
            SetPlayerSkin(ID, skin);
            new string[128], name[24], name2[24];
            GetPlayerName(playerid, name, 24);
            GetPlayerName(ID, name2, 24);
       
            format(string, 128, "Administrator %s[%d] has set your skin to %d", name, playerid, skin);
            SendClientMessage(ID, COLOR_YELLOW, string);
       
            format(string, 128, "You have seted %s skin to %d", name2, skin);
            SendClientMessage(playerid, COLOR_YELLOW, string);
        }
    }
    return 1;
}
Reply


Messages In This Thread
Help /setskin - by Linus- - 28.12.2010, 12:04
Re: Help /setskin - by SAMPGammer - 28.12.2010, 12:06
Re: Help /setskin - by Linus- - 28.12.2010, 12:11
Re: Help /setskin - by JaTochNietDan - 28.12.2010, 12:40
Re: Help /setskin - by Linus- - 28.12.2010, 12:43
Re: Help /setskin - by JaTochNietDan - 28.12.2010, 12:46
Re: Help /setskin - by Linus- - 28.12.2010, 12:50
Re: Help /setskin - by JaTochNietDan - 28.12.2010, 12:51
Re: Help /setskin - by Linus- - 28.12.2010, 12:53
Re: Help /setskin - by JaTochNietDan - 28.12.2010, 12:57

Forum Jump:


Users browsing this thread: 1 Guest(s)