Symbol is assigned..
#1

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

its cause the symbol its never used

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

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

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.
Reply
#5

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

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

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!
Reply
#8

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;
}
Reply
#9

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;
    }
Reply
#10

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


Forum Jump:


Users browsing this thread: 2 Guest(s)