GetPlayerName help.
#1

I want to make LandInfo[land][landOwner] = to GetPlayerNameEX how can i do it. when i type : if(LandInfo[land][landOwner] = GetPlayerName(playerid))

i get error : array must be indexed any help?
Reply
#2

You can't use '==' in strings, use strcmp.
PHP код:
    new pName[MAX_PLAYER_NAME];
    
GetPlayerName(playeridpNamesizeof(pName));
    if(!
strcmp(LandInfo[land][landOwner], pName))
    {
        
// player names matches.
        
    

and your LandOwner variable should be like that
PHP код:
LandOwner[MAX_PLAYER_NAME
Reply
#3

my [landOwner] is in enum.....
Reply
#4

In the enum change to this:
PHP код:
LandOwner[129], 
Reply
#5

in my enum it was like this:

Код:
enum landblabla
{
landOwner[ MAX_PLAYER_NAME ]
}
will it work for your code @pawnhunter ?
Reply
#6

Yes @Alpha000, It will work.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)