[Tutorial] AFK command with Reason [ZCMD] [sscanf2]
#2

Good, but:

pawn Код:
new afk[MAX_PLAYERS];

CMD:afk(playerid, params[])
{
    new reason[28], Name[MAX_PLAYER_NAME], Inf[100];
    if(sscanf(params, "s[28]", reason)) return SendClientMessage(playerid, -1, "Use: /afk <Reason>");
    afk[playerid] = afk[playerid] == 1 ? 0 : 1;
    GetPlayerName(playerid, Name, sizeof(Name));
    format(Inf, sizeof(Inf), "%s are: %s. Reason: %s", Name, afk[playerid] == 1 ? ("AFK") : ("To back"), reason);
    SendClientMessageToAll(-1, Inf);
    TogglePlayerControllable(playerid, afk[playerid] == 1 ? 0 : 1);
    return 1;
}
Reply


Messages In This Thread
AFK command with Reason [ZCMD] [sscanf2] - by MrViolence101 - 01.01.2015, 18:04
Re: AFK command with Reason [ZCMD] [sscanf2] - by Dolpin - 01.01.2015, 19:26
Re: AFK command with Reason [ZCMD] [sscanf2] - by LivingLikeYouDo - 02.01.2015, 13:33
Re: AFK command with Reason [ZCMD] [sscanf2] - by biker122 - 02.01.2015, 13:47
Re: AFK command with Reason [ZCMD] [sscanf2] - by AndySedeyn - 02.01.2015, 22:42
Re: AFK command with Reason [ZCMD] [sscanf2] - by AndySedeyn - 02.01.2015, 23:18

Forum Jump:


Users browsing this thread: 1 Guest(s)