OnPlayerCommandText FR
From SA-MP Wiki
(Difference between revisions)
Revision as of 17:08, 5 January 2013 Connor Mead (Talk | contribs) ← Previous diff |
Revision as of 12:03, 18 January 2014 Connor Mead (Talk | contribs) Next diff → |
||
Line 1: | Line 1: | ||
- | [[Category:Scripting Callbacks_FR]] | + | {{ScriptingFR}} |
+ | {{Title}} | ||
+ | |||
+ | {{Description|This callback is called when a player enters a command into the client chat window, e.g. /help.}} | ||
+ | |||
+ | {{ParametersFR|playerid, cmdtext[]}} | ||
+ | {{Param|playerid|The ID of the player that executed the command.}} | ||
+ | {{Param|cmdtext[]|The command that was executed (including the slash).}} | ||
+ | |||
+ | {{ReturnsFR|'''0''' si aucune commande n'a été exécutée. Sinon '''1'''.}} | ||
+ | |||
+ | <pawn> | ||
+ | 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é. | ||
+ | } | ||
+ | </pawn> | ||
+ | |||
+ | {{RelatedCallbacksFR}} | ||
+ | *[OnPlayerText_FR|OnPlayerText]] | ||
+ | *[[OnRconCommand_FR|OnRconCommand]] | ||
+ | |||
+ | {{RelatedFunctionsCallback}} | ||
+ | {{SendRconCommand}} | ||
+ | |||
+ | [[Category:Scripting Callbacks FR]] |
Revision as of 12:03, 18 January 2014
Page d'Accueil | Les Fonctions | Les Callbacks | Les bases du Scripting | Plugins de Serveur | Tutoriaux
Ne prenez pas en compte les FR dans les noms
Description:
This callback is called when a player enters a command into the client chat window, e.g. /help.
(playerid, cmdtext[])
playerid | The 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.
- [OnPlayerText_FR|OnPlayerText]]
- OnRconCommand
Related Functions
The following functions might be useful, as they're related to this callback in one way or another.
- SendRconCommand: Sends an RCON command via the script.