/sms command not working.
#7

Quote:
Originally Posted by BuuGhost
Посмотреть сообщение
There's a few issues with your script.

pawn Код:
new gMessage[256];
        new Message[256];
These string don't need to be that big, the max displayable characters in SAMP are 128.

You also should add a return at this piece of code:
pawn Код:
if(!strlen(tmp))
        {
            SendClientMessage(playerid,COLOR_WHITE,"Usage: /sms [number] [message]");
        }
pawn Код:
if(!strlen(gMessage))
        {
            SendClientMessage(playerid,COLOR_WHITE,"Usage: /sms [number] [message]");
        }
So the script 'halts' at that line and doesn't continue.

You also don't return 1; on the bottom of the command.

I have no idea how to use strtok, so I won't comment on additional bugfixes, I myself prefer zcmd and sscanf as that's way easier to use and to-date.
Thank you, fixed a few of my problems. Do you know anyone who could try to fix my error? I found that there is a problem with the usage of the symbol "id". It's a variable that is always equal to 0. I found that out by testing the command with my friend; I was id 0, I successfully received a message from him, he was id 1 - he did not. While we relogged and re-tested it when he was id 0, the same happened, but we switched places; he received a message and he did not. So once again, can anyone help me? :/ I'm out of options here :/
Reply


Messages In This Thread
/sms command not working. - by Gytis0 - 16.06.2012, 22:52
Re: /sms command not working. - by mickos - 16.06.2012, 23:14
Re: /sms command not working. - by [NWA]Hannes - 16.06.2012, 23:17
Re: /sms command not working. - by Gytis0 - 16.06.2012, 23:53
Re: /sms command not working. - by Gytis0 - 19.06.2012, 16:46
Re: /sms command not working. - by Revo - 19.06.2012, 16:53
Re: /sms command not working. - by Gytis0 - 19.06.2012, 22:04
Re: /sms command not working. - by Gytis0 - 22.06.2012, 10:07
Re: /sms command not working. - by nilanjay - 22.06.2012, 10:13
Re: /sms command not working. - by Gytis0 - 27.06.2012, 17:59

Forum Jump:


Users browsing this thread: 5 Guest(s)