OnPlayerCommandText FR

From SA-MP Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 12:03, 18 January 2014
Connor Mead (Talk | contribs)

← Previous diff
Revision as of 12:03, 18 January 2014
Connor Mead (Talk | contribs)

Next diff →
Line 26: Line 26:
{{RelatedCallbacksFR}} {{RelatedCallbacksFR}}
-*[OnPlayerText_FR|OnPlayerText]]+*[[OnPlayerText_FR|OnPlayerText]]
*[[OnRconCommand_FR|OnRconCommand]] *[[OnRconCommand_FR|OnRconCommand]]

Revision as of 12:03, 18 January 2014




Description:

This callback is called when a player enters a command into the client chat window, e.g. /help.


Paramètres:
(playerid, cmdtext[])
playeridThe ID of the player that executed the command.
cmdtext[]The command that was executed (including the slash).


Retourne:

0 si aucune commande n'a été exécutée. Sinon 1.


public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/help", true))
    {
        SendClientMessage(playerid, 0xFFFFFFFF, "SERVEUR: C'est la commande /help !");
        return 1;
        // Retourner 1 informe au serveur que la commande a bien été exécutée.
        // OnPlayerCommandText ne sera pas appelé dans d'autres scripts.
    }
    return 0;
    // Si aucun script ne retourne 1, le message 'SERVER: Unknown Command' sera affiché.
}

Callback Relatives

Les Callbacks ci dessous sont indirectement ou directement liées à cette Callback.

Related Functions

The following functions might be useful, as they're related to this callback in one way or another.