/pm Commands
#1

I know its a simple command, but I get errors "Server: Unknown Command" and Im not sure if it sends the message or not
pawn Код:
CMD:pm(playerid,params[]){
    new id,message;
    if(sscanf(params,"uz",id,message)) return SendClientMessage(playerid,COLOR_GRAY,"SYNTAX: /pm [ID] [Message]");
    else{
    new string[128];
    format(string,sizeof(string),"PM From %s: %s",GetName(id),params);
    SendClientMessage(playerid,COLOR_YELLOW,string);
    format(string,sizeof(string),"PM To %s: %s",GetName(playerid),params);
    SendClientMessage(playerid,COLOR_YELLOW,string);
    }
    return 1;
}
Reply
#2

LOL Its really Wrong Command.

pawn Код:
CMD:pm(playerid, params[])
{
    new id, message;
    if(sscanf(params,"us[128]", id, Message))
    {
        new string[128];
        format(string, sizeof(string),"PM From %s[ID: %d]: %s", GetName(id), id, Message);
        SendClientMessage(playerid, -1, string);
       
        format(string, sizeof(string),"PM To %s[ID: %d]: %s", GetName(playerid), id, Message);
        SendClientMessage(id, -1, string);
    }
    else SendClientMessage(playerid, -1,"Usage: /pm [id][message]");
    return 1;
}
Rep
Reply
#3

Quote:
Originally Posted by $India$
Посмотреть сообщение
LOL Its really Wrong Command.

pawn Код:
CMD:pm(playerid, params[])
{
    new id, message;
    if(sscanf(params,"us[128]", id, Message))
    {
        new string[128];
        format(string, sizeof(string),"PM From %s[ID: %d]: %s", GetName(id), id, Message);
        SendClientMessage(playerid, -1, string);
       
        format(string, sizeof(string),"PM To %s[ID: %d]: %s", GetName(playerid), id, Message);
        SendClientMessage(id, -1, string);
    }
    else SendClientMessage(playerid, -1,"Usage: /pm [id][message]
    return 1;
}
Rep
That's even worse, and DO NOT ASK FOR REP. Make sure that OnPlayerCommandPerformed + OnPlayerCommandReceived returning 1 and that you actually have the script loaded.
Reply
#4

I have fixed that.
pawn Код:
");
Forgot to put that
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)