/sms command not working.
#4

Quote:
Originally Posted by [NWA]Hannes
Посмотреть сообщение
Here you only check if the number has the same length as the number param, you dont check if the number is correct.
Try using strval but I have no idea if it would work
I did what you said, and made a few tweaks to the command. Here's the command:
pawn Код:
if(strcmp("/sms", cmd, true) == 0)
    {
    if(PlayerInfo[playerid][pPhone] >= 1)
    {
        tmp = strtok(cmdtext,idx);

        if(!strlen(tmp))
        {
            SendClientMessage(playerid,COLOR_WHITE,"Usage: /sms [number] [message]");
        }
        new id;
        new gMessage[256];
        new Message[256];
        new pName[MAX_PLAYER_NAME+1];
       
        new number;
        number = PlayerInfo[playerid][pNr];

        gMessage = strrest(cmdtext,idx);

        if(!strlen(gMessage))
        {
            SendClientMessage(playerid,COLOR_WHITE,"Usage: /sms [number] [message]");
        }

        if(PlayerInfo[id][pNr] == strval(tmp))
        {
            GetPlayerName(playerid,pName,sizeof(pName));
            format(Message,sizeof(Message),"%s(%d): %s",pName,number,gMessage);
            SendClientMessage(id,COLOR_YELLOW,Message);
            PlayerPlaySound(id,1085,0.0,0.0,0.0);
        }
    }
    else
    {
    SendClientMessage(playerid, COLOR_WHITE, "You don't have a cellphone. Buy one at any 24/7 store.");
    }
    }
Now, what my problem is, that I CAN message myself, my friend CAN message me and I CAN'T message him. I'm thinking, maybe this is because my id was 0, and his id was 1? I just don't get it, I just don't know what else to do.
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: 3 Guest(s)