SA-MP Forums Archive
A little problem with /setskin - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: A little problem with /setskin (/showthread.php?tid=241693)



A little problem with /setskin - Rivera - 18.03.2011

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?!


Re: A little problem with /setskin - antonio112 - 18.03.2011

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


Re: A little problem with /setskin - Rivera - 18.03.2011

Quote:

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

lol... "horrible" mistake

fixed...


Re: A little problem with /setskin - Rivera - 18.03.2011

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?


Re: A little problem with /setskin - Hashski - 18.03.2011

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


Re: A little problem with /setskin - Sascha - 18.03.2011

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