Need help with one /pm command
#1

https://sampwiki.blast.hk/wiki/OnPlayerPrivmsg - I get the command from here, and when I compile the script show me this:

How to fix these errors?
Reply
#2

give line 90,91,93.94,96
Reply
#3

Line 90
pawn Код:
tmp = strtok(cmdtext,idx);
Line 91
pawn Код:
if(!strlen(tmp)) return SendClientMessage(playerid,0xFF0000FF,"USAGE: /PM (id) (message)");
Line 93
pawn Код:
gMessage = strrest(cmdtext,idx);
Line 94
pawn Код:
if(!strlen(gMessage)) return SendClientMessage(playerid,0xFF0000FF,"Usage: /pm (id) (message)");
Line 96
pawn Код:
GetPlayerName(id,iName,sizeof(iName));
Reply
#4

did you define strtok and the other things as stocks or vars and w/e in the script?
Reply
#5

I don't even need to see the lines to tell you, you didn't define those variables.
Reply
#6

pawn Код:
strtok(const string[], &index)
{
    new length = strlen(string);
    while ((index < length) && (string[index] <= ' '))
    {
        index++;
    }
 
    new offset = index;
    new result[20];
    while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
    {
        result[index - offset] = string[index];
        index++;
    }
    result[index - offset] = EOS;
    return result;
}
and new tmp[124];
Reply
#7

I already resolve it with doreto's help on skype. Thanks anyway!
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)