OnRconCommand FR
From SA-MP Wiki
(Difference between revisions)
Revision as of 21:37, 31 January 2014 Connor Mead (Talk | contribs) ← Previous diff |
Revision as of 21:46, 31 January 2014 Connor Mead (Talk | contribs) Next diff → |
||
Line 1: | Line 1: | ||
{{ScriptingFR}} | {{ScriptingFR}} | ||
- | {{Description|This callback is called when a command is sent through the server console, remote RCON, or via the in-game /rcon command.}} | + | {{Description|Cette callback est appelée lorsqu'une commande est exécutée dans la console, ou via le jeu avec les commandes RCON.}} |
{{ParametersFR|cmd[]}} | {{ParametersFR|cmd[]}} | ||
- | {{Param|cmd[]|A string containing the command that was typed, as well as any passed parameters.}} | + | {{Param|cmd[]|Une chaîne contenant la commande écrite.}} |
- | {{ReturnsFR|'''0''' if the command was not processed, it will be passed to another script or '''1''' if the command was processed, will not be passed to other scripts.}} | + | {{ReturnsFR|'''0''' if the command was not processed, it will be passed to another script or '''1''' if the command was processed, will not be passed to other scripts.}}{{traduct}} |
- | {{Note2FR| You will need to include this callback in a loaded filterscript for it to work in the gamemode!}} | + | {{Note2FR| You will need to include this callback in a loaded filterscript for it to work in the gamemode!}} {{traduct}} |
{{notes| | {{notes| | ||
- | * "/rcon " is not included in "cmd" when a player types a command. | + | * "/rcon " n'est pas inclut dans "cmd" lorsqu'un joueur tape la commande. |
- | * If you use the "print" function here, it will send a message to the player who typed the command in-game as well as the log.}} | + | * Si vous utilisez la fonction "printf" dans cette callback, un message sera envoyé au joueur qui a tapé la commande dans le jeu, et dans les logs.}} |
<pawn> | <pawn> | ||
Line 27: | Line 27: | ||
{ | { | ||
SendClientMessageToAll(0xFFFFFFAA, "Bonjour tous le monde!!"); | SendClientMessageToAll(0xFFFFFFAA, "Bonjour tous le monde!!"); | ||
+ | print("Vous avez envoyé un message de bonjour à tous les joueurs!"); | ||
return 1; | return 1; | ||
} | } |
Revision as of 21:46, 31 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:
Cette callback est appelée lorsqu'une commande est exécutée dans la console, ou via le jeu avec les commandes RCON.
(cmd[])
cmd[] | Une chaîne contenant la commande écrite. |
Retourne:
0 if the command was not processed, it will be passed to another script or 1 if the command was processed, will not be passed to other scripts.
Note | You will need to include this callback in a loaded filterscript for it to work in the gamemode! |
public OnRconCommand(cmd[]) { printf("[RCON]: Vous avez écrit '/rcon %s'!", cmd); return 0; }
public OnRconCommand(cmd[]) { if(!strcmp(cmd, "bonjour", true)) { SendClientMessageToAll(0xFFFFFFAA, "Bonjour tous le monde!!"); print("Vous avez envoyé un message de bonjour à tous les joueurs!"); return 1; } return 0; }
Fonctions Relatives
Les fonctions suivantes peuvent être utiles car elles sont indirectement ou directement liées a cette fonction.
- IsPlayerAdmin: Vérifie si un joueur est connecté en RCON.
Callbacks Relatives
Les Callbacks suivantes peuvent être utiles car elles sont indirectement ou directement liées a cette fonction.
- OnRconLoginAttempt: Appelée lorsqu'un joueur essaie de se connecter en RCON.