Returning
#1

Hi,

Small question, how do I return a formatted message and PlayerPlaySound for OnPlayerCommandText?
Thanks

Code,

new string[150];
format(string, sizeof(string), "Error: The command %s is unknown", cmdtext);
SendClientMessage(playerid, -1, string);
xPlayerPlaySound( playerid, 31202);
Reply
#2

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/mycommand", cmdtext, true, 10) == 0)
    {
        // Do something here
        return 1;
    }
    else
    {
    new string[150];
    format(string, sizeof(string), "Error: The command %s is unknown", cmdtext);
    xPlayerPlaySound( playerid, 31202);
    return  SendClientMessage(playerid, -1, string);
    }
}
Reply
#3

Thank you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)