/me command issue
#1

So I made a /me command from scratch:

pawn Код:
CMD:me(playerid, params[])
{
    if(IsPlayerConnected(playerid))
    {
        new message;
        if(sscanf(params, "s", message)) return SendClientMessage(playerid, CYAN, "[USAGE]: /me [text]. This command will display a local message, used for showing actions.");
        {
            new string[128];
            format(string, sizeof(string), "*[ACTION]* %s: %s", ReturnPlayerName(playerid), message);
            ProxDetector(30.0, playerid, string, PURPLE,PURPLE,PURPLE,PURPLE,PURPLE);
        }
    }
    return 1;
}
When I type /me with only two letters after (like /me hi) it works, but if I type more than 2 letters it doesn't work. It just says "Unknown Command".
Reply
#2

new message[256];
Reply
#3

pawn Код:
CMD:me(playerid, params[])
{
    if(IsPlayerConnected(playerid))
    {
        new message[128];
        if(sscanf(params, "s[128]", message)) return SendClientMessage(playerid, CYAN, "[USAGE]: /me [text]. This command will display a local message, used for showing actions.");
        else
        {
            new string[128];
            format(string, sizeof(string), "*[ACTION]* %s: %s", ReturnPlayerName(playerid), message);
            ProxDetector(30.0, playerid, string, PURPLE,PURPLE,PURPLE,PURPLE,PURPLE);
        }
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)