[FilterScript] Sistema AFK v2.0
#1

Desculpem, por ter feito aquele FS antigo, desculpem se eu fiz besteira, vou posta a atualizaзгo aqui.

esse code й simples mais ъtil.

pawn Код:
#include <a_samp>

new Celula[128], Nome[24], bool:AFK[MAX_PLAYERS];

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print("FS AFK Criado Por Mau Tito Ligado.");
    print("--------------------------------------\n");
    return true;
}

public OnFilterScriptExit()
{
    print("\n--------------------------------------");
    print("FS AFK Desligado.");
    print("--------------------------------------\n");
    return true;
}

main()
{
    print("\n----------------------------------");
    print("Criado Por Mau Tito e Editado Pelo Jonathan.");
    print("----------------------------------\n");
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/afk", cmdtext, true) == 0)
    {
        if(AFK[playerid] == true) return SendClientMessage(playerid, -1," Vocк Jб Estб AFK");
        AFK[playerid] = true;
        TogglePlayerControllable(playerid, 0);
        GetPlayerName(playerid, Nome, sizeof(Nome));
        format(Celula, sizeof(Celula), "{1E90FF}O Player {7FFFD4}%s {1E90FF}Ficou AFK.", Nome);
        SendClientMessageToAll(-1, Celula);
        return 1;
    }
    if (strcmp("/sairafk", cmdtext, true) == 0)
    {
        if(AFK[playerid] == false) return SendClientMessage(playerid, -1," Vocк Jб Nгo Estб AFK.");
        AFK[playerid] = false;
        TogglePlayerControllable(playerid, 1);
        GetPlayerName(playerid, Nome, sizeof(Nome));
        format(Celula, sizeof(Celula), "{1E90FF}O Player {7FFFD4}%s {1E90FF}Saiu AFK.", Nome);
        SendClientMessageToAll(-1, Celula);
        return true;
    }
    if (strcmp("/playersafk", cmdtext, true) == 0)
    {
       SendClientMessage(playerid, 0xFF0000FF , "~x Players AFK x~");
       for(new i = 0; i < MAX_PLAYERS; i++)
       {
            if(IsPlayerConnected(i))
            {
                 if((AFK[i] == true))
                 {
                      GetPlayerName(i, Nome, sizeof(Nome));
                      format(Celula, 128, "%s", Nome);
                      SendClientMessage(playerid, -1, Celula);
                 }
            }
       }
       return true;
    }
    return false;
}
aceito criticas, ta simples mais estou a melhorar, sou iniciante.
Reply


Messages In This Thread
Sistema AFK v2.0 - by mau_tito - 28.08.2011, 00:06
Re: Sistema AFK v2.0 - by histire - 28.08.2011, 00:08
Re: Sistema AFK v2.0 - by Lipe_Stronda - 28.08.2011, 00:12
Re: Sistema AFK v2.0 - by mau_tito - 28.08.2011, 00:15
Re: Sistema AFK v2.0 - by JonathanFeitosa - 28.08.2011, 00:21
Re: Sistema AFK v2.0 - by MaGnO_357 - 28.08.2011, 00:26
Re: Sistema AFK v2.0 - by histire - 28.08.2011, 00:31
Re: Sistema AFK v2.0 - by Bruno Pereira - 28.08.2011, 00:31
Re: Sistema AFK v2.0 - by BrunoBSF - 28.08.2011, 00:32
Re: Sistema AFK v2.0 - by Lipe_Stronda - 28.08.2011, 00:33

Forum Jump:


Users browsing this thread: 1 Guest(s)