SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 09/07/2009, 06:20 PM   #1
Coicatak
Huge Clucker
 
Join Date: Nov 2008
Posts: 354
Reputation: 0
Default Juqt a small question about random func

When I compile my script I get this:

Code:
C:\Documents and Settings\Sébastien\Mes documents\GTA\samp02Xserver.win32\gamemodes\BCL-RP.pwn(3146) : warning 204: symbol is assigned a value that is never used: "RandomFemaleSkin"
C:\Documents and Settings\Sébastien\Mes documents\GTA\samp02Xserver.win32\gamemodes\BCL-RP.pwn(3140) : warning 204: symbol is assigned a value that is never used: "RandomMaleSkin"
But the code seems good and it works IG :/ What's wrong?
pawn Code:
stock RandomSkin(playerid)
{
    if(PlayerInfo[playerid][pSex] == 1)
    {
        new RandomMaleSkin[7][] = { {60}, {66}, {101}, {128}, {170}, {180}, {188} };
        new rand = random(sizeof(RandomMaleSkin));
        SetPlayerSkin(playerid, rand);
    }
    else if(PlayerInfo[playerid][pSex] == 2)
    {
        new RandomFemaleSkin[7][] = { {56}, {69}, {93}, {141}, {150}, {191}, {193} };
        new rand = random(sizeof(RandomFemaleSkin));
        SetPlayerSkin(playerid, rand);
    }
}

Thanks in advance
Coicatak is offline  
Old 09/07/2009, 06:26 PM   #2
yom
High-roller
 
Join Date: Jul 2006
Posts: 2,014
Reputation: 5
Default Re: Juqt a small question about random func

I really doubt it's working in game. And why creating 2 dimensions if you only use one? Learning from GF? Bad idea.

Actually you never use RandomMaleSkin or the other (you only use it in sizeof which is evaluated when compiling), so it show these warnings.

pawn Code:
stock RandomSkin(playerid)
{
  if(PlayerInfo[playerid][pSex] == 1)
  {
    new RandomMaleSkin[] = { 60, 66, 101, 128, 170, 180, 188 };
    new rand = RandomMaleSkin[random(sizeof(RandomMaleSkin))];
    SetPlayerSkin(playerid, rand);
  }
  else
  {
    new RandomFemaleSkin[] = { 56, 69, 93, 141, 150, 191, 193 };
    new rand = RandomFemaleSkin[random(sizeof(RandomFemaleSkin))];
    SetPlayerSkin(playerid, rand);
  }
}
yom is offline  
Old 09/07/2009, 06:53 PM   #3
Coicatak
Huge Clucker
 
Join Date: Nov 2008
Posts: 354
Reputation: 0
Default Re: Juqt a small question about random func

Thanks
Coicatak is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
A Small Question TheNuttyScientist Help Archive 2 19/05/2010 07:57 PM
Small question. DiddyBop Help Archive 3 16/01/2010 11:14 PM
small question? MARTLMHK Help Archive 2 04/01/2010 12:45 PM
Hello, small question balisticore Help Archive 4 29/08/2009 05:11 AM


All times are GMT. The time now is 01:46 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.