SA-MP Forums Archive
[Tutorial] [TUT] Random Skins - 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: Tutorials (https://sampforum.blast.hk/forumdisplay.php?fid=70)
+---- Thread: [Tutorial] [TUT] Random Skins (/showthread.php?tid=139456)



[TUT] Random Skins - PatrickChucky - 05.04.2010

Hi, I am PatrickChucky, and this is my first TUT.

Is about "How to create Random Skins

In this TUT i create random skins with command and at the spawn

Lets go!

Through the command:

Over public OnGameModeInit()

Код:
new skins[] = {
  0, //Here you put the id of the skin
  1, //Here you put the id of the skin
  2 //Here you put the id of the skin
};
now at public OnPlayerCommandText(playerid, cmdtext[])

Код:
if(strcmp(cmd, /testcmd, true) == 0)
{
    SetPlayerSkin(skins[random(3)];
}
now Through the spawn:

Over public OnGameModeInit()

Код:
new skins[] = {
  0, //Here you put the id of the skin
  1, //Here you put the id of the skin
  2 //Here you put the id of the skin
};
now at public OnPlayerSpawn(playerid)

Код:
{
  SetPlayerSkin(playerid, skins[random(3)]);	 //[random(3)] -->>> the 3 is the numver of skins you but in public OnGameModeInit
  return 1;
}

P.S: Remember, if you want more skins change the number in //[random(3)] to the number of skins you have

easy I think




Re: [TUT] Random Skins - zSuYaNw - 22.05.2010

Quote:
Originally Posted by [PT
PatrickChucky™ ]
Hi, I am PatrickChucky, and this is my first TUT.

Is about "How to create Random Skins

In this TUT i create random skins with command and at the spawn

Lets go!

Through the command:

Over public OnGameModeInit()

Код:
new skins[] = {
  0, //Here you put the id of the skin
  1, //Here you put the id of the skin
  2 //Here you put the id of the skin
};
now at public OnPlayerCommandText(playerid, cmdtext[])

Код:
if(strcmp(cmd, /testcmd, true) == 0)
{
   SetPlayerSkin(skins[random(3)];
}
now Through the spawn:

Over public OnGameModeInit()

Код:
new skins[] = {
  0, //Here you put the id of the skin
  1, //Here you put the id of the skin
  2 //Here you put the id of the skin
};
now at public OnPlayerSpawn(playerid)

Код:
{
  SetPlayerSkin(playerid, skins[random(3)]);	 //[random(3)] -->>> the 3 is the numver of skins you but in public OnGameModeInit
  return 1;
}

P.S: Remember, if you want more skins change the number in //[random(3)] to the number of skins you have

easy I think

God


Re: [TUT] Random Skins - Antonio [G-RP] - 22.05.2010

Centering it makes it look wierd..


Re: [TUT] Random Skins - PatrickChucky - 18.06.2010

Quote:
Originally Posted by TheGarfield
God
God? or Good xD


OFF

(( ja vi que vc й BR eu sou PT obrigado))


Re: [TUT] Random Skins - Flake. - 18.06.2010

hehe nice for beginner scripters


Re: [TUT] Random Skins - Simon - 09.07.2010

If you want a more flexible and easy to edit code then use "sizeof(skins)" instead of "3" for your random number limit .


Re: [TUT] Random Skins - dino_d_carter - 19.10.2012

Thx +rep


Re: [TUT] Random Skins - InTeL_cOrE_i7 - 03.02.2013

or... lol just use this
Quote:

SetPlayerSkin(playerid, 1+random(299));




Re: [TUT] Random Skins - iManakoss - 03.02.2013

Very nice Tut...


Re: [TUT] Random Skins - NimaKhan - 16.01.2014

NICE