Run time error 4: "Array index out of bounds"
#3

Yes you need to check for INVALID_PLAYER_ID
PHP код:
CMD:id(playeridparams[]) 

    new 
idstring[144]; 
    if(
sscanf(params"u"id)) 
        return 
SendClientMessage(playeridCOLOR_RED,"Use: /id [Nume/ID]"); 
    if(
id != INVALID_PLAYER_ID)
    {
        
format(stringsizeof(string), "Name:%s(%i) | Scor:%i | Class:%s | Admin:%i | VIP:%i"pName(id), id,APlayerData[id][PlayerScore], GetPlayerClassEx(id), APlayerData[id][PlayerLevel], APlayerData[id][VPlayerLevel]); 
        
SendClientMessage(playeridGreystring); 
    }
    else 
        return 
SendClientMessage(playeridCOLOR_RED"Error: Invalid PlayerID/PlayerName.");
    return 
1

Reply


Messages In This Thread
Run time error 4: "Array index out of bounds" - by Banditul18 - 13.02.2017, 15:06
Re: Run time error 4: "Array index out of bounds" - by JesterlJoker - 13.02.2017, 15:10
Re: Run time error 4: "Array index out of bounds" - by Mic_H - 13.02.2017, 15:10
Re: Run time error 4: "Array index out of bounds" - by JesterlJoker - 13.02.2017, 15:16

Forum Jump:


Users browsing this thread: 1 Guest(s)