[Tutorial] [TUT] Random Skins
#1

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

Reply
#2

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
Reply
#3

Centering it makes it look wierd..
Reply
#4

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


OFF

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

hehe nice for beginner scripters
Reply
#6

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

Thx +rep
Reply
#8

or... lol just use this
Quote:

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

Reply
#9

Very nice Tut...
Reply
#10

NICE
Reply


Forum Jump:


Users browsing this thread: 7 Guest(s)