OnPlayerCommandText FR
From SA-MP Wiki
(Difference between revisions)
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
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.
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.