SA-MP Forums Archive
Warning? But i dont know What i need to change - 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: Warning? But i dont know What i need to change (/showthread.php?tid=107391)



Warning? But i dont know What i need to change - GforceNL - 09.11.2009

Hey i Got This Warning?
Код:
local variable "tmp" shadows a variable at a preceding level
This is the line:
Код:
	  new tmp[256];
Can you help me?
Thanks



Re: Warning? But i dont know What i need to change - Tigerbeast11 - 09.11.2009

Try changing the tmp to something like ltm

Its a guess, just try it...
Im a beginner so dont say that im crap if it doesnt work...


Re: Warning? But i dont know What i need to change - GforceNL - 09.11.2009

Quote:
Originally Posted by Tigerbeast11
Try changing the tmp to something like ltm

Its a guess, just try it...
Im a beginner so dont say that im crap if it doesnt work...
thnx it works but i have another problem :S

When i type a command Doesn't matter what command. The i get the Gang System :S
Because that one is going to come when i type /ganghelp :S

The Command:
Код:
  if(strcmp(cmd, "/ganghelp", true) == 0) {
		SendClientMessage(playerid, COLOR_RED,   "|------| Legends GangSystem |------|");
		SendClientMessage(playerid, COLOR_YELLOW,   "/gang Create [Name]");
		SendClientMessage(playerid, COLOR_YELLOW,   "/gang Join");
		SendClientMessage(playerid, COLOR_YELLOW,   "/gang invite [PlayerID]");
		SendClientMessage(playerid, COLOR_YELLOW,   "/gang Leave");
		SendClientMessage(playerid, COLOR_YELLOW,   "/ganginfo [GangID]");
		SendClientMessage(playerid, COLOR_YELLOW,   "! [Text] Gangchat with your Gang");
		SendClientMessage(playerid, COLOR_RED,   "|-----------------------------------|");
		return 1;
	}



Re: Warning? But i dont know What i need to change - Tigerbeast11 - 09.11.2009

PM me the script, the bug might be somewhere else


Re: Warning? But i dont know What i need to change - Tigerbeast11 - 09.11.2009

Im sorry,. there i dont know what is making the bug...


Can someone else help this guy plz?


Re: Warning? But i dont know What i need to change - Rickyboy30 - 09.11.2009

Yes, you forgot one { after the command line lol, so it has to be this:

Код:
  if(strcmp(cmd, "/ganghelp", true) == 0)
  {
       SendClientMessage(playerid, COLOR_RED,   "|------| Legends GangSystem |------|");
       SendClientMessage(playerid, COLOR_YELLOW,   "/gang Create [Name]");
	SendClientMessage(playerid, COLOR_YELLOW,   "/gang Join");
	SendClientMessage(playerid, COLOR_YELLOW,   "/gang invite [PlayerID]");
	SendClientMessage(playerid, COLOR_YELLOW,   "/gang Leave");
	SendClientMessage(playerid, COLOR_YELLOW,   "/ganginfo [GangID]");
	SendClientMessage(playerid, COLOR_YELLOW,   "! [Text] Gangchat with your Gang");
	SendClientMessage(playerid, COLOR_RED,   "|-----------------------------------|");
	return 1;
  }



Re: Warning? But i dont know What i need to change - kukars22 - 09.11.2009

Quote:
Originally Posted by Rickyboy30
Yes, you forgot one { after the command line lol, so it has to be this:

Код:
  if(strcmp(cmd, "/ganghelp", true) == 0)
  {
      SendClientMessage(playerid, COLOR_RED,  "|------| Legends GangSystem |------|");
      SendClientMessage(playerid, COLOR_YELLOW,  "/gang Create [Name]");
	SendClientMessage(playerid, COLOR_YELLOW,  "/gang Join");
	SendClientMessage(playerid, COLOR_YELLOW,  "/gang invite [PlayerID]");
	SendClientMessage(playerid, COLOR_YELLOW,  "/gang Leave");
	SendClientMessage(playerid, COLOR_YELLOW,  "/ganginfo [GangID]");
	SendClientMessage(playerid, COLOR_YELLOW,  "! [Text] Gangchat with your Gang");
	SendClientMessage(playerid, COLOR_RED,  "|-----------------------------------|");
	return 1;
  }
He already have it but not under command, but at the end of line:

Код:
if(strcmp(cmd, "/ganghelp", true) == 0) {
Do you have 1st one tmp[258] also?


Re: Warning? But i dont know What i need to change - Virtual1ty - 10.11.2009

Quote:
Originally Posted by GforceNL
Hey i Got This Warning?
Код:
local variable "tmp" shadows a variable at a preceding level
This is the line:
Код:
	  new tmp[256];
Can you help me?
Thanks
this is because you have a tmp variable defined somewhere elsewhere under OnPlayerCommandText
and for the other bug, that gang shit cmd shows up and not the wanted one, there has to be your fault somewhere in other command