Sim , mais um sistema afk .Porem nao tao igual ao resto.
pawn Код:
#include a_samp
#include zcmd
#include sscanf2
#define DialogAFK 99
new bool:afk[MAX_PLAYERS];
new Don[80];
new PlayersAfk;
new Text3D:AFKS;
new DName[MAX_PLAYER_NAME];
new IDName[MAX_PLAYER_NAME];
public OnFilterScriptInit(){ return 1; }
public OnFilterScriptExit(){ return 1; }
public OnPlayerConnect(playerid)
{
afk[playerid] = false;
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
return 1;
}
cmd(afk,playerid,params[])
{
new horas, minutos, segundos;
gettime(horas,minutos,segundos);
new DHoras, DMinutos, DSegundos;
gettime(DHoras,DMinutos,DSegundos);
if(afk[playerid] == false)
{
GetPlayerName(playerid, DName,sizeof(DName));
format(Don,sizeof(Don),"-Info- O jogador %s(ID:%d) entrou no modo ausente ( /afk ).", DName , playerid);
SendClientMessage(playerid,-1,Don);
afk[playerid] = true;
new Float:Pos[3];
GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
SetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]+50);
new Float:Vida[1];
GetPlayerHealth(playerid,Vida[0]);
SetPlayerHealth(playerid,Vida[0]+100000);
TogglePlayerControllable(playerid,1);
format(Don,sizeof(Don),"[AFK]%s", DName);
SetPlayerName(playerid, Don);
PlayersAfk++;
format(Don,sizeof(Don),"-Info- Voce ficou ausente as %i:%i:%i", horas, minutos, segundos);
SendClientMessage(playerid,-1,Don);
format(Don,sizeof(Don),"-Info- Player ausente desdas %i:%i:%i", horas, minutos, segundos);
Create3DTextLabel(Don,0xF00ECAA,Pos[0],Pos[1],Pos[2],50.0,0);
Attach3DTextLabelToPlayer(Text3D:AFKS,playerid,0.0,0.0,4.0);
}
else
{
format(Don,sizeof(Don),"-Info- O jogador %s(ID:%d) saiu do modo ausente ( /afk ).", DName , playerid);
SendClientMessage(playerid,-1,Don);
afk[playerid] = false;
new Float:Pos[3];
GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
SetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]-50);
new Float:Vida[1];
GetPlayerHealth(playerid,Vida[0]);
SetPlayerHealth(playerid,Vida[0]-100000);
TogglePlayerControllable(playerid,0);
format(Don,sizeof(Don),"%s", DName);
SetPlayerName(playerid, Don);
format(Don,sizeof(Don),"-Info- Voce ficou ausente as %i:%i:%i e voltou as %i:%i:%i", horas, minutos, segundos, DHoras, DMinutos, DSegundos);
SendClientMessage(playerid,-1,Don);
Delete3DTextLabel(Text3D:AFKS);
}
return true;
}
cmd(playersafk,playerid,params[])
{
for(new x=0; x<MAX_PLAYERS; x++)
{
new Speed[50];
if(afk[x]== true)
{
GetPlayerName(i, DName,sizeof(DName));
format(Don,sizeof(Don),"| %s[ID:%d] |AFK\n", DName,x);
strcat(Speed, Don);
}
ShowPlayerDialog(playerid, DialogAFK, DIALOG_STYLE_MSGBOX, "Players Afk", Speed, "Ok","");
}
return true;
}
cmd(afkshoje,playerid,params[])
{
if(!IsPlayerAdmin(playerid))return SendClientMessage(playerid,-1,"-Erro- Apenas logado na Rcon");
format(Don,sizeof(Don),"-Info- Total de players AFK hoje %i.",PlayersAfk);
SendClientMessageToAll(-1,Don);
return true;
}
cmd(resetar,playerid,params[])
{
if(!IsPlayerAdmin(playerid))return SendClientMessage(playerid,-1,"-Erro- Apenas logado na Rcon");
GetPlayerName(playerid, DName,sizeof(DName));
format(Don,sizeof(Don),"-Info- AFKґs resetado pelo admin %s(ID%d).",DName,playerid);
SendClientMessageToAll(-1,Don);
PlayersAfk = 0;
return true;
}
cmd(acusar,playerid,params[])
{
new Float:Pos[3], ID;
if(sscanf(params,"d",ID))return SendClientMessage(playerid,-1,"-Uso- /acusar[id]");
if(afk[ID] == true)return SendClientMessage(playerid,-1,"-Erro- Ele esta ausente ( /afk )");
GetPlayerPos(ID,Pos[0],Pos[1],Pos[2]);
if(IsPlayerInRangeOfPoint(playerid, 3.0,Pos[0],Pos[1],Pos[2]))return SendClientMessage(playerid, -1,"-Erro- Player Nao Esta Perto");
SetTimerEx("Posicao",8000,false,"iifff",playerid,ID,Pos[0],Pos[1],Pos[2]);
GameTextForPlayer(ID,"~r~se mova pra nao ser kickado", 3000, 3);
GetPlayerName(ID, IDName, sizeof(IDName));
format(Don,sizeof(Don),"-Info- O jogador %s(ID:%d) te acusou de ESC.", IDName, ID);
SendClientMessage(ID,-1,Don);
return true;
}
forward Posicao(playerid,ID,Float:X,Float:Y,Float:Z);
public Posicao(playerid,ID,Float:X,Float:Y,Float:Z)
{
new Float:Pos[3];
GetPlayerPos(ID,Pos[0],Pos[1],Pos[2]);
if (Pos[0] == X && Pos[1] == Y && Pos[2] == Z)
{
GetPlayerName(ID, IDName, sizeof(IDName));
format(Don,sizeof(Don),"-Info- O jogador %s(ID:%d) foi chutado do server.[Motivo: ESC].", IDName, ID);
SendClientMessage(ID,-1,Don);
Kick(ID);
}else GameTextForPlayer(ID,"Nao foi kickado se mexeu a tempo", 3000, 3);
return true;
}