Quote:
Originally Posted by Necip
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[]) { if(strcmp("/afk", cmdtext, true, 10) == 0) { new Name[MAX_PLAYER_NAME]; // Defining the Player's Name GetPlayerName(playerid, Name, sizeof(Name)); if (isAFK[playerid] == 0) // if the player is NOT AFK { isAFK[playerid] = 1; // Turning his state to AFK mode format( string, sizeof(string), "%s is AFK !", Name); // Formatting the message to be sended SendClientMessageToAll(-1 , string); // Sends message to everyone to inform he is AFK, put a color in yourcolorhere part of this code to make it work. } else { // if the player is already AFK isAFK[playerid] = 0; // Turning his state to NO-AFK mode format( string, sizeof(string), "%s is back!", Name); // Formatting the message to be sended SendClientMessageToAll(-1, string); // Sends message to inform he is back , put a color in yourcolorhere part of this code to make it work. } return 1; } return 1; }
|
The last should be "return 0;".
Quote:
Originally Posted by Rufio
pawn Код:
if(strcmp("/afk", cmdtext, true, 10) == 0)
|
"/afk" has 4 lenght, not 10. Well, the lenght is option so it's better not to use it at all if it's gonna be incorrect or use it with the correct lenght.