SA-MP Forums Archive
[Tutorial] Criando um Sistema De AFK - Nivel : Medio - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+----- Forum: Lançamentos/Releases (https://sampforum.blast.hk/forumdisplay.php?fid=56)
+----- Thread: [Tutorial] Criando um Sistema De AFK - Nivel : Medio (/showthread.php?tid=213221)



Criando um Sistema De AFK - Nivel : Medio - Trinix_PoS [Bizu] - 18.01.2011

Bom Primeiro Venho Falar Que Esse Post e Uma Resposta a um, post parecido aqui no forum samp mas nao explicado !!!

1є Definindo Cores Que Serгo Usadas :

No Topo Do Seu GM Abaixo Das Includes
pawn Код:
#define COLOR_GRAD1 0xC0C0C0AA
2є Passo Vamos Fazer O Comando
Vб A Public OnPlayerCommandText
pawn Код:
if (strcmp("/goafk", cmdtext, true, 10) == 0)
    {
       
                TogglePlayerControllable(playerid,0);
                SetPlayerHealth(playerid, 9999);
                GetPlayerName(i,sendername,sizeof(sendername));
        format(string, 256, "%s Ficou Ausente (/goafk)", sendername);
               SendClientMessageToAll(COLOR_GRAD1, string);
        return 1;
    }
Explicando :

pawn Код:
TogglePlayerControllable(playerid,0); // Aqui Agente Seta Para Congelar o Player
 SetPlayerHealth(playerid, 9999); // Aqui Setamos a Vida Do Player Para Infinita
GetPlayerName(i,sendername,sizeof(sendername)); /// pegamos o nome do player aqui
format(string,256,"%s Ficou Ausente (/goafk)",sendername);// Formatamos a mensagen
SendClientMessageToAll(playerid,COLOR_GRAD1,string); // setamos para anunciar para todos do servidor o evento
return 1; /// returnamos ue
3є Passo : Criar Comando /exitafk
Vб A Public OnPlayerCommandText

pawn Код:
if (strcmp("/exitafk", cmdtext, true, 8) == 0)
    {
        TogglePlayerControllable(playerid,1);
                SetPlayerHealth(playerid, 100);
                GetPlayerName(i,sendername,sizeof(sendername));
        format(string,256,"%s Saiu Do Ausente (/exitafk)",sendername);
        SendClientMessageToAll(playerid,COLOR_GRAD1,string);
        return 1;
    }
Explicando :
pawn Код:
TogglePlayerControllable(playerid,1); // setamos para descongelar o player
SetPlayerHealth(playerid, 100); // setamos a vida para completa mas nao infiita
GetPlayerName(i,sendername,sizeof(sendername)); // pegamos o nome do player
format(string,256,"%s Saiu Do Ausente (/exitafk)",sendername);// Formatamos a mensagen
SendClientMessageToAll(playerid,COLOR_GRAD1,string); // enviamos a menssagem
return 1; // returnamos
Pronto .. mais explicado e mas util



Re: Criando um Sistema De AFK - Nivel : Medio - zSuYaNw - 18.01.2011

Muito bom,
Falta este:

pawn Код:
format(string,256,"%s Saiu Do Ausente (/exitafk)",sendername);// Formatamos a mensagen



Re: Criando um Sistema De AFK - Nivel : Medio - Trinix_PoS [Bizu] - 19.01.2011

ah й obrigado ai


Re: Criando um Sistema De AFK - Nivel : Medio - ベータ版 マスター - 19.01.2011

pawn Код:
format(string, 256, "%s Ficou Ausente (/goafk)", sendername);
SendClientMessageToAll(COLOR_GRAD1, string);
Corrija.


Re: Criando um Sistema De AFK - Nivel : Medio - Trinix_PoS [Bizu] - 19.01.2011

ok irei corrigir tb nao vi isso


Re: Criando um Sistema De AFK - Nivel : Medio - Gustavob - 19.01.2011

olha nгo estб ruim estб pйssimo /zoa

mas o cmd pode ser abusado pros players ganharem 100 de vida entao vc deve fazer algo assim:

Quote:

topo:
pawn Код:
new Float:Vida[MAX_PLAYERS]
/goafk:
pawn Код:
GetPlayerHealth(playerid, Vida[playerid]);
/sairafk:
pawn Код:
SetPlayerHealth(playerid, Vida[playerid]);
fikdik


Re: Criando um Sistema De AFK - Nivel : Medio - Trinix_PoS [Bizu] - 19.01.2011

kkk se tenta faze para beneficio ira aparecer no chat de todos os player consecutivamente tipo voce ficou afk logo despois voce saiu ai o adminitrador somente kicka


Re: Criando um Sistema De AFK - Nivel : Medio - ga22briel - 25.02.2011

Ja agradeзo, pelo fs de AFK tava percisando muito by [DRE]Scorpion equipe-dre.blogspot.com