[SOLVED] Random Skin
#1

Hello,

I'm trying to script a function that random put a player skin on spawn, the thing works but, it adds skin ids I dont want to be there...

Here is the main function with the id's:

Код:
new CivMaleSkins[150][1] = {

{1},{2},{7},{14},{15},{16},{17},{18},{19},{20},{21},{22},{23},{24},{25},{26},{27},{28},{29},{30},{32},{33},{34},{35},{36},{37},{43},{44},{45},{46},{47},{48},{49},
{50},{51},{52},{57},{58},{59},{60},{61},{62},{66},{67},{68},{72},{73},{78},{79},{80},{81},{82},{83},{84},{95},{96},{97},{98},{99},
{100},{101},{111},{112},{113},{117},{118},{120},{121},{122},{123},{124},{125},{126},{127},{128},{133},{134},{135},{136},{137},{142},{143},{146},{147},
{153},{154},{155},{156},{158},{159},{160},{161},{162},{163},{164},{165},{166},{167},{168},{170},{171},{176},{177},{179},{180},{181},{182},{183},{184},{185},{186},{187},{188},{189},
{200},{202},{206},{209},{210},{212},{213},{217},{220},{221},{222},{223},{227},{228},{229},{230},{234},{235},{236},{239},{240},{241},{242},{247},{248},{249},
{250},{253},{254},{255},{258},{259},{260},{261},{262},{264}
};
This includes almost all Male skins in GTA San Andreas, but sometimes a girl skin can get added to a player, I have checked every skin id, and I cant find any Female id...

Here is the function when the skins gets added to the player:

Код:
	if(RegistrationStep[playerid] > 0)
	{
	  if(RegistrationStep[playerid] == 1)
	  {
	    new idx;
	  	tmp = strtok(text, idx);
		  if((strcmp("male", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("male")))
			{
			  new maleskin;
			  ClearChatbox(playerid, 10);
  				SendClientMessage(playerid, COLOR_LIGHT_YELLOW, "Okay, so you are a Male.");
			  SendClientMessage(playerid, COLOR_LIGHT_RED, "Thank you for filling in the information.");
			  maleskin = random(sizeof(CivMaleSkins));
			  SetPlayerSkin(playerid, maleskin);
			  PlayerInfo[playerid][pReg] = 1;
			  PlayerInfo[playerid][pGender] = 1;
			  PlayerInfo[playerid][pChar] = maleskin;
				RegistrationStep[playerid] = 0;
			  return 0;
			}
And here is the Warning I get:

Код:
symbol is never used: "CivMaleSkins"
What can the problem be?
Reply
#2

You need to random inside the group, but this is equal to random(150) so change it to;

new rand = random(sizeof(CivMaleSkins));
SetPlayerSkin(playerid, CivMaleSkins[rand][]);
Reply
#3

Quote:
Originally Posted by Thrarod
new rand = random(sizeof(CivMaleSkins));
SetPlayerSkin(playerid, CivMaleSkins[rand][0]);
Reply
#4

Sorry
Reply
#5

Quote:
Originally Posted by » RyDeR «
Quote:
Originally Posted by Thrarod
new rand = random(sizeof(CivMaleSkins));
SetPlayerSkin(playerid, CivMaleSkins[rand][0]);
Thanks, that solved it!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)