I Need Help, again
#1

Hello all!

I was working on a PM command and it works. However, it can only send 1 word at a time. Can you guys help me out again?

pawn Код:
Code Removed
Thank You,
Cody Maverak
Reply
#2

LOL You cant make chat commands with strtok !!!!
you need the stock of strrest or more recommended is to use sscanf2
!!!
Reply
#3

still stuck in strtok? switch to sscanf.
Reply
#4

so how would i do this in sscanf?
Reply
#5

Have fun, it's in zcmd btw.

pawn Код:
COMMAND:pm(playerid, params[])
{
    new targetid, string[128], message[128];

    if(sscanf(params,"uS(No message specified)[128]",targetid,message)) return SendClientMessage(playerid,SERVER_ORANGE," Correct usage is /pm [ name/id ] [ message ].");

    format(string, sizeof(string),"[ Received PM ] %s[%d]: %s",Player[playerid][name],playerid,message);
    SendClientMessage(targetid,PLAYER_COLOR_YELLOW,string);

    format(string, sizeof(string),"[ Sent PM ] %s[%d]: %s",Player[targetid][name],targetid,message);
    SendClientMessage(playerid,PLAYER_COLOR_YELLOW,string);
    return true;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)