SA-MP Forums Archive
Problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Problem (/showthread.php?tid=451778)



Problem - Mauricee - 18.07.2013

Код:
[17:44:07] [debug] Run time error 4: "Array index out of bounds"
[17:44:07] [debug]  Accessing element at negative index -1
[17:44:07] [debug] AMX backtrace:
[17:44:07] [debug] #0 00031754 in public ShowStats (0x00000001, 0x00000001) from wgm.amx
[17:44:07] [debug] #1 000f3a24 in public cmd_stats (0x00000001, 0x001daf28) from wgm.amx
[17:44:07] [debug] #2 native CallLocalFunction () [00471e90] from samp-server.exe
[17:44:07] [debug] #3 00007040 in public OnPlayerCommandText (0x00000001, 0x001daf0c) from wgm.amx
pawn Код:
CMD:stats(playerid, params[])
{
    if (gPlayerLogged[playerid] != 0)
    {
        ShowStats(playerid,playerid);
    }
    else
    {
        SendClientMessage(playerid, COLOR_GRAD1, "   You are not Logged in !");
    }
    return 1;
}
#define function%0(%1) forward %0(%1); public %0(%1)
function ShowStats(playerid,targetid)
{
    if(IsPlayerConnected(playerid)&&IsPlayerConnected(targetid))
    {
        SendClientMessage(playerid, COLOR_GREEN,"My Stats");
    }
    return 1;
}



Re: Problem - SuperViper - 18.07.2013

Show the full ShowStats function.


Re: Problem - Mauricee - 18.07.2013

Solved. I forgot I redefined IsPlayerConnected