OnPlayerCommandText
#4

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
Open zcmd.inc and replace:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (zcmd_g_HasOPCS && !CallLocalFunction("OnPlayerCommandReceived", "is", playerid, cmdtext))
    {
        return 1;
    }
    new
        pos,
        funcname[MAX_FUNC_NAME];
    while (cmdtext[++pos] > ' ')
    {
        funcname[pos-1] = tolower(cmdtext[pos]);
    }
    format(funcname, sizeof(funcname), "cmd_%s", funcname);
    while (cmdtext[pos] == ' ') pos++;
    if (!cmdtext[pos])
    {
        if (zcmd_g_HasOPCE)
        {
            return CallLocalFunction("OnPlayerCommandPerformed", "isi", playerid, cmdtext, CallLocalFunction(funcname, "is", playerid, "\1"));
        }
        return CallLocalFunction(funcname, "is", playerid, "\1");  
    }
    if (zcmd_g_HasOPCE)
    {
        return CallLocalFunction("OnPlayerCommandPerformed", "isi", playerid, cmdtext, CallLocalFunction(funcname, "is", playerid, cmdtext[pos]));
    }
    return CallLocalFunction(funcname, "is", playerid, cmdtext[pos]);
}
with:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (zcmd_g_HasOPCS && !CallLocalFunction("OnPlayerCommandReceived", "is", playerid, cmdtext))
    {
        return 1;
    }
    new
        pos,
        funcname[MAX_FUNC_NAME];
    while (cmdtext[++pos] > ' ')
    {
        if(pos > MAX_FUNC_NAME) break;
        else funcname[pos-1] = tolower(cmdtext[pos]);
    }
    format(funcname, sizeof(funcname), "cmd_%s", funcname);
    while (cmdtext[pos] == ' ') pos++;
    if (!cmdtext[pos])
    {
        if (zcmd_g_HasOPCE)
        {
            return CallLocalFunction("OnPlayerCommandPerformed", "isi", playerid, cmdtext, CallLocalFunction(funcname, "is", playerid, "\1"));
        }
        return CallLocalFunction(funcname, "is", playerid, "\1");  
    }
    if (zcmd_g_HasOPCE)
    {
        return CallLocalFunction("OnPlayerCommandPerformed", "isi", playerid, cmdtext, CallLocalFunction(funcname, "is", playerid, cmdtext[pos]));
    }
    return CallLocalFunction(funcname, "is", playerid, cmdtext[pos]);
}
Thank you ur always in service best
EDIT:
I got this now
Код:
[15:55:52]+ Number of vehicle models: 86
[15:56:35]+ Incoming connection: 192.168.1.114:51652
[15:56:35]+ [join] test3113 has joined the server (0:192.168.1.114)
[15:56:51]+ [debug] Run time error 4: "Array index out of bounds"
[15:56:51]+ [debug]  Accessing element at index 32 past array upper bound 31
[15:56:51]+ [debug] AMX backtrace:
[15:56:51]+ [debug] #0 0001af9c in ?? (... <2 arguments>) at C:\Users\MaHdy\Desktop\SPA Test\pawno\include\zcmd.inc:94
[15:56:51]+ [debug] #1 00006d6c in public OnPlayerCommandText (playerid=0, cmdtext[]=@0x010d152c "/gsaaaaaaaaaaaaaaaaaaaaaaaaaaa...") at C:\Users\MaHdy\Desktop\SPA Test\pawno\include\YSI\y_hooks/impl.inc:929
[15:56:51]+ [debug] Run time error 4: "Array index out of bounds"
[15:56:51]+ [debug]  Accessing element at index 32 past array upper bound 31
[15:56:51]+ [debug] AMX backtrace:
[15:56:51]+ [debug] #0 00019c40 in ?? (... <2 arguments>) at C:\Users\MaHdy\Desktop\SPA Server original\pawno\include\ZCMD.inc:94
[15:56:51]+ [debug] #1 0000d4bc in public OnPlayerCommandText (playerid=0, cmdtext[]=@0x01080b7c "/gsaaaaaaaaaaaaaaaaaaaaaaaaaaa...") at C:\Users\MaHdy\Desktop\SPA Server original\pawno\include\YSI\y_hooks/impl.inc:929
[15:56:51]+ [debug] Run time error 4: "Array index out of bounds"
[15:56:51]+ [debug]  Accessing element at index 32 past array upper bound 31
[15:56:51]+ [debug] AMX backtrace:
[15:56:51]+ [debug] #0 000002b4 in public OnPlayerCommandText (playerid=0, cmdtext[]=@0x00005808 "/gsaaaaaaaaaaaaaaaaaaaaaaaaaaa...") at C:\Users\MaHdy\Desktop\SPA Server original\pawno\include\zcmd.inc:94
[15:56:51]+ [debug] Run time error 4: "Array index out of bounds"
[15:56:51]+ [debug]  Accessing element at index 32 past array upper bound 31
[15:56:51]+ [debug] AMX backtrace:
[15:56:51]+ [debug] #0 00000200 in public OnPlayerCommandText (0x00000000, 0x000011e8) from maths.amx
[15:56:53]+ [debug] Run time error 4: "Array index out of bounds"
[15:56:53]+ [debug]  Accessing element at index 32 past array upper bound 31
[15:56:53]+ [debug] AMX backtrace:
[15:56:53]+ [debug] #0 0001af9c in ?? (... <2 arguments>) at C:\Users\MaHdy\Desktop\SPA Test\pawno\include\zcmd.inc:94
[15:56:53]+ [debug] #1 00006d6c in public OnPlayerCommandText (playerid=0, cmdtext[]=@0x010d152c "/gsaaaaaaaaaaaaaaaaaaaaaaaaaaa...") at C:\Users\MaHdy\Desktop\SPA Test\pawno\include\YSI\y_hooks/impl.inc:929
[15:56:53]+ [debug] Run time error 4: "Array index out of bounds"
[15:56:53]+ [debug]  Accessing element at index 32 past array upper bound 31
[15:56:53]+ [debug] AMX backtrace:
[15:56:53]+ [debug] #0 00019c40 in ?? (... <2 arguments>) at C:\Users\MaHdy\Desktop\SPA Server original\pawno\include\ZCMD.inc:94
[15:56:53]+ [debug] #1 0000d4bc in public OnPlayerCommandText (playerid=0, cmdtext[]=@0x01080b7c "/gsaaaaaaaaaaaaaaaaaaaaaaaaaaa...") at C:\Users\MaHdy\Desktop\SPA Server original\pawno\include\YSI\y_hooks/impl.inc:929
[15:56:53]+ [debug] Run time error 4: "Array index out of bounds"
[15:56:53]+ [debug]  Accessing element at index 32 past array upper bound 31
[15:56:53]+ [debug] AMX backtrace:
[15:56:53]+ [debug] #0 000002b4 in public OnPlayerCommandText (playerid=0, cmdtext[]=@0x00005808 "/gsaaaaaaaaaaaaaaaaaaaaaaaaaaa...") at C:\Users\MaHdy\Desktop\SPA Server original\pawno\include\zcmd.inc:94
[15:56:53]+ [debug] Run time error 4: "Array index out of bounds"
[15:56:53]+ [debug]  Accessing element at index 32 past array upper bound 31
[15:56:53]+ [debug] AMX backtrace:
[15:56:53]+ [debug] #0 00000200 in public OnPlayerCommandText (0x00000000, 0x000011e8) from maths.amx
[15:56:55]+ [part] test3113 has left the server (0:1)
Reply


Messages In This Thread
OnPlayerCommandText - by Mahde - 04.02.2014, 22:53
Re: OnPlayerCommandText - by Borg - 04.02.2014, 23:19
Re: OnPlayerCommandText - by Konstantinos - 05.02.2014, 09:44
Re: OnPlayerCommandText - by Mahde - 05.02.2014, 12:42
Re: OnPlayerCommandText - by Konstantinos - 05.02.2014, 13:15
Re: OnPlayerCommandText - by Mahde - 05.02.2014, 17:44
Re: OnPlayerCommandText - by Konstantinos - 05.02.2014, 18:46
Re: OnPlayerCommandText - by Mahde - 05.02.2014, 19:29

Forum Jump:


Users browsing this thread: 2 Guest(s)