Warning? But i dont know What i need to change
#1

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

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

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

PM me the script, the bug might be somewhere else
Reply
#5

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


Can someone else help this guy plz?
Reply
#6

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

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

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
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)