GetPlayerName Array must be indexed error
#1

pawn Код:
new playername[MAX_PLAYER_NAME];
    GetPlayerName(playerid,playername,sizeof(playername));
    if(playername == "NameHere")
    {
    Variable[playerid] = 1;
    }
error 033: array must be indexed (variable "playername")
Reply
#2

Sorry,I never had compared strings before so I don't know how to.
Reply
#3

use strcmp function to do so
https://sampwiki.blast.hk/wiki/Strcmp
Код:
if(!strcmp(playerName,"NameHere"))// case senstiive 
{
//means they both match, can be here too when one of those string are empty
}
Reply
#4

Try reading this: https://sampwiki.blast.hk/wiki/Strcmp.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)