help {REP+]
#1

Thsi code crashes my server when used.

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/afk", cmdtext, true, 10) == 0)
    {
        new pname[MAX_PLAYER_NAME], string[22 + MAX_PLAYER_NAME];
        GetPlayerName(playerid, pname, sizeof(pname));
        format(string, sizeof(string), "%s gone AFK, they will not respond until they are back", pname);
        SendClientMessageToAll(0xAAAAAAAA, string);
        SendClientMessage(playerid, 0x00FF22, "You've gone AFK please type /back when your back");
        return 1;
    }
    if (strcmp("/back", cmdtext, true, 10) == 0)
    {
        new pname[MAX_PLAYER_NAME], string[22 + MAX_PLAYER_NAME];
        GetPlayerName(playerid, pname, sizeof(pname));
        format(string, sizeof(string), "%s are back, They will now respond!", pname);
        SendClientMessageToAll(0xAAAAAAAA, string);
        SendClientMessage(playerid, 0x00FF22, "Welcome Back, %s");
        return 1;
    }
    return 0;
}
Also, How to make it freeze you on /afk and unfreeze on /back?
Reply


Messages In This Thread
help {REP+] - by sanplayer - 22.04.2012, 15:45
Re: help {REP+] - by spedico - 22.04.2012, 16:00
Re: help {REP+] - by Twisted_Insane - 22.04.2012, 16:02
Re: help {REP+] - by sanplayer - 22.04.2012, 16:43

Forum Jump:


Users browsing this thread: 1 Guest(s)