array must be indexed help
#1

i have this code guys and i get the error on this line :
PHP код:
if(TeamInfo[i][tName] == PlayerName(playerid)) 
error is that: error 033: array must be indexed (variable "PlayerName")
TeamInfo[i][tName] this contain the player name into an .ini text file , i am using dini ,
PHP код:
stock PlayerName(playerid)
{
    new 
pName[MAX_PLAYER_NAME];
    
GetPlayerName(playeridpNameMAX_PLAYER_NAME);
    return 
pName;

, anyone know?
Reply
#2

Strings cannot be checked like that, use strcmp
Reply
#3

Quote:
Originally Posted by Sjn
Посмотреть сообщение
Strings cannot be checked like that, use strcmp
ok thanks i did it, now i dont have errors, but now the problem is that when i type /og take "Not access" as message but it should open the gates, , the tName into .ini is exactly the same as the player name, whats wrongg?
This is my code
PHP код:
strmid(TeamInfo[i][tName], dini_Get(file"Name"), falsestrlen(dini_Get(file"Name")), MAX_PLAYER_NAME);
if(
strcmp(TeamInfo[i][tName], PlayerName(playerid)))
            {
                
found true;
                if(
TeamInfo[i][tMember] == 1)
                {
                    
MoveObject(airgate4,395.8703613,2374.1357422,25.8018494,3);
                    
MoveObject(airgate5,380.8940735,2366.1770020,25.8284874,3);
                    
AirCloseTimer[playerid] = SetTimer("AirClose"4000true);
                }
            }
        }
    }
    if(!
found) return SendClientMessage(playeridCOLOR_RED"Not Access!"); 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)