A little problem with /setskin
#1

I have compiled a /setskin command, but when I get IG i type /setskin [id] [skin] and it just says "You changed ...'s skin to ..." but my skin isn't changed. Here, the cmd:

pawn Код:
dcmd_setskin(playerid, params[])
{
    new pID, pName[MAX_PLAYER_NAME], string[128], value;
    if(sscanf(params, "ui", pID, value)) return SendClientMessage(playerid, COLOR_GOLD, "/setskin [playerid] [skinid]");
    else if(PlayerInfo[playerid][AdminLevel] <= 3) return SendClientMessage(playerid, COLOR_RED, "You have no acces to this comamnd");
    else if(pID == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GREEN, "Player Not Found");
    else
    {
        GetPlayerSkin(pID);
        GetPlayerName(pID, pName, MAX_PLAYER_NAME);
        format(string, sizeof(string), "You changed (%i) %s's skin to %i", pID, pName, value);
        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
    }
    return 1;
}
When I compile it shows no error. Any help?!
Reply
#2

Instead of GetPlayerSkin(pID), use SetPlayerSkin( pID, value );
Reply
#3

Quote:

Instead of GetPlayerSkin(pID), use SetPlayerSkin( pID, value );

lol... "horrible" mistake

fixed...
Reply
#4

umm... when I get IG, if i type /setskin 0 300 (skins are between 0 and 299) my PC game crashes and I have to restart my PC. Is there something I can do so the game doesn't crashes?
Reply
#5

pawn Код:
if(value < 0 || value > 299) return SendClientMessage(playerid, COLOR_GREY, "SERVER: Cannot go under 0 or above 299.");
To fix the crashes.
Reply
#6

replace the "pID" which hashski wrote with the "value" you want to set the skin to... :P
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)