Array index out of bounds
#1

Since this is really the first time this happened to me, I have no idea how to solve it.

PHP код:
CMD:test(playeridparams[])
{
    new 
string[128];
    
    if(
isnull(params))
        return 
SendClientMessage(playerid, -1"No params");
    
    
format(stringsizeof(string), "TEST: %s (TEST LOCATION: %s)"PlayerName(playerid), zones[player_zone[playerid]][zone_name]);
    
SendClientMessage(playerid, -1string);
    
format(stringsizeof(string), "TEST DESC: %s"params);
    
SendClientMessage(playerid, -1string);
    return 
1;

Код:
[00:57:17] [debug] Run time error 4: "Array index out of bounds"
[00:57:17] [debug]  Accessing element at negative index -1
[00:57:17] [debug] AMX backtrace:
[00:57:17] [debug] #0 0003c1fc in public cmd_test (playerid=0, params[]=@0x00039734 "hsdghsdhgsdg") at C:\xampp\htdocs\samp\gamemodes\wat.pwn:4800
[00:57:17] [debug] #1 native CallLocalFunction () [004743b0] from samp-server.exe
[00:57:17] [debug] #2 000008e0 in public OnPlayerCommandText (playerid=0, cmdtext[]=@0x000396e8 "/test hsdghsdhgsdg") at C:\xampp\htdocs\samp\pawno\include\zcmd.inc:111
Line 4800
PHP код:
format(stringsizeof(string), "TEST: %s (TEST LOCATION: %s)"PlayerName(playerid), zones[player_zone[playerid]][zone_name]); 
If you need anymore (like the zone script) I'll post it.
Reply


Messages In This Thread
Array index out of bounds - by itsCody - 13.12.2015, 04:07
Re: Array index out of bounds - by SickAttack - 13.12.2015, 04:21
Re: Array index out of bounds - by itsCody - 13.12.2015, 04:25
Re: Array index out of bounds - by SickAttack - 13.12.2015, 05:10
Re: Array index out of bounds - by itsCody - 13.12.2015, 05:21

Forum Jump:


Users browsing this thread: 1 Guest(s)