SA-MP Forums Archive
What is wrong with this command - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: What is wrong with this command (/showthread.php?tid=252764)



What is wrong with this command - BizzyD - 02.05.2011

Hello, I got a problem in my /pm command.

This is a half bit of it.

pawn Код:
cmd = strtok(cmdtext, idx);
    if(strcmp(cmd, "/pm", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GREEN, "/pm [id] [text]");
                return 1;
            }
This is the errors i get:
Line 27:
Код:
error 047: array sizes do not match, or destination array is too small
Line 32:
Код:
error 047: array sizes do not match, or destination array is too small
This is line 27:

Код:
cmd = strtok(cmdtext, idx);
And this is line 32:
Код:
tmp = strtok(cmdtext, idx);
Anyone know how to fix this?

Thanks, Alex


Re: What is wrong with this command - [KO]KillerThriller - 02.05.2011

do you have
new cmd[256] and new tmp[256]?


Re: What is wrong with this command - BizzyD - 02.05.2011

lol that was the problem :P Anyways thanks.


Re: What is wrong with this command - [KO]KillerThriller - 02.05.2011

Np...