"string" shadows a variable...
#1

ERROR:

PHP код:
C:\Users\----\Desktop\Programs\NIS\SERVER\SERVER\filterscripts\LuxAdmin.pwn(593) : warning 219local variable "string" shadows a variable at a preceding level 
Script:

PHP код:
    if(AccInfo[playerid][Level] > 1)
    {
    new 
pname[MAX_PLAYER_NAME], string[100 MAX_PLAYER_NAME];
    {
    
GetPlayerName(playeridpnamesizeof(pname));
    
format(stringsizeof(string), "{0xFFFFFFAA}Administrator {05B1F5}%s{FFFFFF} has joined the server."pname);
    
SendClientMessageToAll(0xFFFFFFAAstring);
    return 
0;
    }
    }
    if(
ServerInfo[ConnectMessages] == 1)
    {
        if(
AccInfo[playerid][Level] > 1)
    {
           new 
pAKA[256];
         
pAKA dini_Get("LuxAdmin/Config/aka.txt",tmp3);
        if (
strlen(pAKA) < 3)
        
format(str,sizeof(str),"*{0xFFFFFFAA}Administrator {007fff}%s {00007f}(Id:%d){FFFFFF}) has joined the server"PlayerName,playerid);
        for(new 
0MAX_PLAYERSi++)
        if(
IsPlayerConnected(i) && playerid != i)
    {
        if(
AccInfo[playerid][Level] > 1)
        
SendClientMessage(i,grey,str);
        else
        {
        
format(string,sizeof(string),"* {0xFFFFFFAA}Administrator {007fff}%s {00007f}(Id:%d){FFFFFF} has joined the server"PlayerNameplayerid);
         
SendClientMessage(i,grey,string);
        }
        }
        }
        } 
Reply
#2

you made two like this

pawn Код:
new string[128];
remove one
Reply
#3

this line:
pawn Код:
new pname[MAX_PLAYER_NAME], string[100 + MAX_PLAYER_NAME];
should be
pawn Код:
new pname[MAX_PLAYER_NAME];
You already have string defined somewhere so you don't need it there.
Reply
#4

Quote:
Originally Posted by Mean
Посмотреть сообщение
this line:
pawn Код:
new pname[MAX_PLAYER_NAME], string[100 + MAX_PLAYER_NAME];
should be
pawn Код:
new pname[MAX_PLAYER_NAME];
You already have string defined somewhere so you don't need it there.
Am getting these errors now:
Код:
C:\Users\----\Desktop\Programs\NIS\SERVER\SERVER\filterscripts\LuxAdmin.pwn(4636) : error 033: array must be indexed (variable "AccInfo")
C:\Users\----\Desktop\Programs\NIS\SERVER\SERVER\filterscripts\LuxAdmin.pwn(4638) : error 033: array must be indexed (variable "AccInfo")
C:\Users\----\Desktop\Programs\NIS\SERVER\SERVER\filterscripts\LuxAdmin.pwn(4641) : error 033: array must be indexed (variable "AccInfo")
C:\Users\----\Desktop\Programs\NIS\SERVER\SERVER\filterscripts\LuxAdmin.pwn(4643) : error 047: array sizes do not match, or destination array is too small
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Lines:
Код:
dcmd_tg(playerid,params[])
{
    #pragma unused params
	if(AccInfo[playerid] == true)
	{
	    AccInfo[playerid] = false;
		return SendClientMessage(playerid,yellow,"|- You have disabled /goto, no one can teleport to you now -|");
	}
	else if(AccInfo[playerid] == false)
	{
	    AccInfo[playerid] = true;
		return SendClientMessage(playerid, yellow, "|- You have enabled /goto, anyone can teleport to you now -|");
	}
	return 1;
}
Reply
#5

Show More Code
Reply
#6

Which code lines do you want me too show?
Reply
#7

It's
pawn Код:
if(AccInfo[playerid][/* something_here about toggling goto (from your enum) */] == true)
{
    //code;
}
else if(AccInfo[playerid][/* something_here about toggling goto (from your enum) */] == false)
{
    //code;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)