Command to change skin
#10

Right as LAs Venturas CNR said it doesnt detect invalid IDS and if someone set your skin as an invalid ID you'll crash. Try my ZCMD and sscanf setskin cmd
Also this works only for admins whos level is 4 but you can change that value to whatever you desire.
pawn Код:
CMD:setskin(playerid, params[])
{
    new id, ammount, name[MAX_PLAYER_NAME], string[128];
    if(!(PlayerInfo[playerid][pAdmin] >= 4)) return SendClientMessage(playerid, COLOR_GREY,"You are not authorized to use this command");
    else if(sscanf(params,"ui", id, ammount)) return SendClientMessage(playerid, COLOR_GREY,"[True:RP]: /setskin [playerid/partofname] [skinmodel]");
    else if(ammount > 299 || ammount < 1) return SendClientMessage(playerid, COLOR_GREY,"Wrong Skin ID! Available ID's: 1-299");
    else if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_GREY,"Invalid player id");
    else
    {
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string),"Your skin have been set to %i by admin %s", ammount, name);
    SendClientMessage(id, COLOR_GREEN, string);
    PlayerInfo[id][pSkin] = ammount;
    SetPlayerSkin(id, PlayerInfo[id][pSkin]);
    }
    return 1;
}
Reply


Messages In This Thread
Command to change skin - by Aram555 - 17.01.2010, 02:48
Re: Command to change skin - by Miguel - 17.01.2010, 03:00
Re: Command to change skin - by Kostas' - 25.09.2011, 13:15
Re: Command to change skin - by dice7 - 25.09.2011, 13:30
Re: Command to change skin - by Kostas' - 25.09.2011, 15:08
Re: Command to change skin - by MA_proking - 25.09.2011, 16:53
Re: Command to change skin - by Kostas' - 25.09.2011, 18:27
Re: Command to change skin - by Kingunit - 25.09.2011, 18:37
Re: Command to change skin - by Kostas' - 25.09.2011, 19:12
Re: Command to change skin - by SantarioLeone - 26.09.2011, 01:31

Forum Jump:


Users browsing this thread: 6 Guest(s)