3 Warnings +REP
#1

CLOSED.
Reply
#2

1. Remove new x; on line35.

2. Looks like pName is already a global variable, so delete new pName[24] or rename it.
Reply
#3

Can you write down the code into a
Код:
One like this
or into a PHP code? SO I Can know the pawno code and the errors
Reply
#4

For the first function, you've declared 2 times the variable "x".

Код:
stock GetNumberOfPlayersOnThisIP(test_ip[])//&&&&&&&&&&&&&&&&&&&&&&&stock&&&&&&&
{
	new against_ip[32+1];
	new x = 0; //line 35
	new ip_count = 0;
	for(new x, m = GetMaxPlayers(); x<m; x++) { //line 37
		if(IsPlayerConnected(x)) {
			GetPlayerIp(x,against_ip,32);
			if(!strcmp(against_ip,test_ip)) ip_count++;
		}
	}
	return ip_count;
}
For the second function, have you already a variable global "pName" ?

Think to use the BBCode [php] or [code] when you post a code.
Reply
#5

Both of the warnings basically means that you already have the variable in question defined.

In the first case, you have
Код:
new x = 0;
, however a few lines down in the loop, you redefine x in the loop as
Код:
for(new x....
which causes the warnings. Just either get rid of the "new x = 0;" or use "for(x, m = GetMaxPlayers(); x<m; ++)" to fix the first one.

The second one is more than likely the case that somewhere in the script, pName is being declared a global variable, so you need to look wherever else pName is being used.

EDIT: Everyone literally gathered on this thread lol
Reply
#6

I changed new x to new xip but i got this:


C:\Users\Rodrigo\Desktop\xef-origenale\Gamemodes\xef.pwn(1737) : warning 219: local variable "xip" shadows a variable at a preceding level
C:\Users\Rodrigo\Desktop\xef-origenale\Gamemodes\xef.pwn(1735) : warning 204: symbol is assigned a value that is never used: "xip"
Reply
#7

Quote:
Originally Posted by Rodri99
Посмотреть сообщение
I changed new x to new xip but i got this:


C:\Users\Rodrigo\Desktop\xef-origenale\Gamemodes\xef.pwn(1737) : warning 219: local variable "xip" shadows a variable at a preceding level
C:\Users\Rodrigo\Desktop\xef-origenale\Gamemodes\xef.pwn(1735) : warning 204: symbol is assigned a value that is never used: "xip"
Show the code.
Reply
#8

You must change only one new x to new xip
Reply
#9

INFO CLOSED.
Reply
#10

You should've just removed it like Sergei said. The instruction could hardly be any more clear.
Reply
#11

Why do you declare variables, if you know that you will not use it ?
Reply
#12

Quote:
Originally Posted by Dutheil
Посмотреть сообщение
Why do you declare variables, if you know that you will not use it ?
Because he has no idea what he is doing.


Now where is my rep.
Reply
#13

Quote:
Originally Posted by Sergei
Посмотреть сообщение
Now where is my rep.
Ahaha :'))))
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)