Command HELP
#4

Tried it but don't work. Anyways it will be easy if i give my command and you guys can reply with the edit.

pawn Код:
if (strcmp("/afk", cmdtext, true, 10) == 0)
    {
    if(AFK[playerid] == 0)
    {
    new pname[MAX_PLAYER_NAME], string[39 + MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, sizeof(pname));
    format(string, 280, "%s has gone AFK.", pname);
    SendClientMessageToAll(COLOR_PINK, string);
    TogglePlayerControllable(playerid,0);
    AFK[playerid] = 1;
    }
    else return SendClientMessage(playerid, COLOR_RED, "ERROR: You are already AFK.");
    return 1;
    }
   
    if (strcmp("/back", cmdtext, true, 10) == 0)
    {
    if(AFK[playerid] == 1)
    {
    new pname[MAX_PLAYER_NAME], string[39 + MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, sizeof(pname));
    format(string, 280, "%s is now back from being AFK.", pname);
    SendClientMessageToAll(COLOR_PINK, string);
    TogglePlayerControllable(playerid,1);
    AFK[playerid] = 0;
    }
    else return SendClientMessage(playerid, COLOR_RED, "ERROR: You aren't AFK.");
    return 1;
    }
I want when player is afk to be unable to speak. ( only the player can type /back )
Reply


Messages In This Thread
Command HELP - by necrobg3 - 24.09.2012, 19:53
Re: Command HELP - by ejul - 25.09.2012, 06:10
Re: Command HELP - by clarencecuzz - 25.09.2012, 06:35
Re: Command HELP - by necrobg3 - 25.09.2012, 07:37
Re: Command HELP - by XtremeR - 25.09.2012, 07:42
Re: Command HELP - by YourLord - 25.09.2012, 07:56
Re: Command HELP - by necrobg3 - 25.09.2012, 08:15
Re: Command HELP - by YourLord - 25.09.2012, 08:20
Re: Command HELP - by necrobg3 - 25.09.2012, 10:36
Re: Command HELP - by necrobg3 - 25.09.2012, 18:53

Forum Jump:


Users browsing this thread: 1 Guest(s)