SA-MP Forums Archive
Symbol is assigned.. - 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: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Symbol is assigned.. (/showthread.php?tid=156124)



Symbol is assigned.. - Galcio - 21.06.2010

Hi, I get this warning; " symbol is assigned a value that is never used: "shoename" ". I thought I already have assigned it, or am I wrong here?

pawn Code:
if(strcmp(cmd, "/searchshoe", true) == 0)
  {
    if(IsPlayerInRangeOfPoint(playerid, 15, -437.0859,850.9317,1.3435))
    {
      new shoe = random(2)+1;
      new shoename;
      if(shoe == 1) { shoename = ShoeInfo[playerid][pShoe] = 1; }
      else { shoename = SendClientMessage(playerid, 0xFFFFFFFF, "You did not find any shoe."); }
      return 1;
    }
    return 1;
   }
Thanks


Re: Symbol is assigned.. - Cameltoe - 21.06.2010

its cause the symbol its never used

set #pragma unused shoename at the top of your script until you wanna use the symbol


Re: Symbol is assigned.. - Niixie - 21.06.2010

And it wont work that way, you cant first set pShoe to 1 and after that make it a string without useing a str. if that can do it


Re: Symbol is assigned.. - Galcio - 21.06.2010

Quote:
Originally Posted by [MWR
Niixie ]
And it wont work that way, you cant first set pShoe to 1 and after that make it a string without useing a str. if that can do it
What? Explain please.


Re: Symbol is assigned.. - Lorenc_ - 21.06.2010

Quote:
Originally Posted by [MWR
Niixie ]
And it wont work that way, you cant first set pShoe to 1 and after that make it a string without useing a str. if that can do it
yer, btw to get rid of the error assign it to an function


Re: Symbol is assigned.. - ledzep - 21.06.2010

Well that's the first time I've seen an enum about shoes. Very interesting.


Re: Symbol is assigned.. - Galcio - 21.06.2010

Basically I stole a /coin system and re-made it to how I wanted it. So I can't really see where it went wrong!


Re: Symbol is assigned.. - DJDhan - 21.06.2010

Quote:

shoename = ShoeInfo[playerid][pShoe] = 1;

Rofl.

Code:
if(strcmp(cmd, "/searchshoe", true) == 0)
{
	if(IsPlayerInRangeOfPoint(playerid, 15, -437.0859,850.9317,1.3435))
	{
		new shoe = random(2)+1;

		if(shoe == 1) 
		{ 
			ShoeInfo[playerid][pShoe] = 1; 
		}
		else 
		{ 
			SendClientMessage(playerid, 0xFFFFFFFF, "You did not find any shoe."); 
		}

	}
	return 1;
}



Re: Symbol is assigned.. - Galcio - 21.06.2010

Thanks, that worked.. and while we are at it, I get a tag mismatch now.

pawn Code:
if(strcmp(cmd, "/searchshoe", true) == 0)
    {
        if(IsPlayerInRangeOfPoint(playerid, 15, -437.0859,850.9317,1.3435))
        {
            new shoe = random(2)+1;

            if(shoe == 1)
            {
                ShoeInfo[playerid][pShoe] = 1;
                PlayerActionMessage(playerid,15.0,"starts looking for a shoe.");
               
            }
            else
            {
                new healthhh;
             
                GetPlayerHealth(playerid, healthhh),SetPlayerHealth(playerid, healthhh-10);
            }

        }
        return 1;
    }



Re: Symbol is assigned.. - Cameltoe - 21.06.2010

set it to:
Code:
{
new healthhh; // remove!
SetPlayerHealth(playerid, GetPlayerHealth(playerid)-10);
}
will work i think.