SA-MP Forums Archive
Returning - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Returning (/showthread.php?tid=353069)



Returning - [SF]OutLawZ - 22.06.2012

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);


Re: Returning - [MM]RoXoR[FS] - 22.06.2012

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);
    }
}



Re: Returning - [SF]OutLawZ - 22.06.2012

Thank you.