SA-MP Forums Archive
Random skin - 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: Random skin (/showthread.php?tid=77680)



Random skin - FreeSoul - 13.05.2009

How can I make it like,if the player is in a certian point and types like /skin (I know how to do this part) it will give him a random skin from let's say like,8 specific skins.

Thanks in advance and have a nice day


Re: Random skin - Weirdosport - 13.05.2009

You will need an array of your chosen skins:
pawn Код:
new Skins[] = { 8, 167, 10 };
And then the command:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/skin", cmdtext, true, 5) == 0)
    {
        SetPlayerSkin(playerid, Skins[random(sizeof(Skins))]);
        return 1;
    }
    return 0;
}
I haven't tested, but it compiles alright.. I think it should work.. Just change "8, 167, 10" to suit your needs.