Random skin in range - 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)
+--- Thread: Random skin in range (
/showthread.php?tid=305489)
Random skin in range -
lamarr007 - 22.12.2011
Hi, itґs me again. Please, how can I do, if i want to random skin in range 105-107 (like SetPlayerSkin(playerid, random(105,106,107)) ?
Re: Random skin in range -
spedico - 22.12.2011
Put somewhere in your script:
Код:
stock minrand(min, max) //By Alex "******" Cole
{
return random(max - min) + min;
}
Код:
SetPlayerSkin(playerid, minrand(105, 107));
Re: Random skin in range -
[ABK]Antonio - 22.12.2011
pawn Код:
new randskin = random(3)
switch(randskin)
{
case 0: SetPlayerSkin(playerid, 105);
case 2: SetPlayerSkin(playerid, 106);
case 3: SetPlayerSkin(playerid, 107);
}