new parafk;
if(strcmp(cmd, "/afk", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(parafk == 1)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s estб afk.", sendername);
SendClientMessageToAll(COLOR_LIGHTBLUE, string);
TogglePlayerControllable(playerid,0);
SetPlayerHealth(playerid, 9999);
PlayerPlaySound(playerid,1054,0.0,0.0,0.0);
SetPlayerVirtualWorld(playerid, 1);
return 1;
}
return 1;
}
if(strcmp(cmd, "/sairafk", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(parafk == 0)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s voltou para o servidor.", sendername);
SendClientMessageToAll(COLOR_LIGHTBLUE, string);
TogglePlayerControllable(playerid,1);
SetPlayerHealth(playerid, 100);
PlayerPlaySound(playerid,1054,0.0,0.0,0.0);
SetPlayerVirtualWorld(playerid, 0);
return 1;
}
return 1;
}
if(strcmp(cmd, "/listaway", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(parafk == 1)
{
SendClientMessage(COLOR_LIGHTBLUE,"Jogadores Away:");
format(string, sizeof(string), "Jogador: %s.", sendername);
SendClientMessage(COLOR_WHITE, string);
return 1;
}
return 1;
}
if(strcmp(cmd, "/afk", true) == 0)
{
if(IsPlayerConnected(playerid))
{
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s estб afk.", sendername);
SendClientMessageToAll(COLOR_LIGHTBLUE, string);
TogglePlayerControllable(playerid,0);
SetPlayerHealth(playerid, 9999);
PlayerPlaySound(playerid,1054,0.0,0.0,0.0);
SetPlayerVirtualWorld(playerid, 1);
parafk = 1;
return 1;
}
return 1;
}
if(strcmp(cmd, "/sairafk", true) == 0)
{
if(IsPlayerConnected(playerid))
{
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s voltou para o servidor.", sendername);
SendClientMessageToAll(COLOR_LIGHTBLUE, string);
TogglePlayerControllable(playerid,1);
SetPlayerHealth(playerid, 100);
PlayerPlaySound(playerid,1054,0.0,0.0,0.0);
SetPlayerVirtualWorld(playerid, 0);
parafk = 0;
return 1;
}
return 1;
}
if(strcmp(cmd, "/listaway", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(parafk == 1)
{
SendClientMessage(COLOR_LIGHTBLUE,"Jogadores Away:");
format(string, sizeof(string), "Jogador: %s.", sendername);
SendClientMessage(COLOR_WHITE, string);
return 1;
}
return 1;
}
new PlayerAfk[MAX_PLAYERS];
if(strcmp(cmd, "/afk", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerAfk[playerid] == 0)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s estб afk.", sendername);
SendClientMessageToAll(COLOR_LIGHTBLUE, string);
TogglePlayerControllable(playerid,0);
SetPlayerHealth(playerid, 9999);
PlayerPlaySound(playerid,1054,0.0,0.0,0.0);
SetPlayerVirtualWorld(playerid, 1);
PlayerAfk[playerid] = 1;
return 1;
}
else
{
SendClientMessage(playerid, 0xFFFFFFAA, "Vocк jб estб AFK.");
return 1;
}
}
return 1;
}
if(strcmp(cmd, "/sairafk", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerAfk[playerid] == 1)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s voltou para o servidor.", sendername);
SendClientMessageToAll(COLOR_LIGHTBLUE, string);
TogglePlayerControllable(playerid,1);
SetPlayerHealth(playerid, 100);
PlayerPlaySound(playerid,1054,0.0,0.0,0.0);
SetPlayerVirtualWorld(playerid, 0);
PlayerAfk[playerid] = 0;
return 1;
}
else
{
SendClientMessage(playerid, 0xFFFFFFAA, "Vocк nгo estб AFK.");
return 1;
}
}
return 1;
}
if(strcmp(cmd, "/listaway", true) == 0)
{
for(new i=0; i<MAX_PLAYERS; ++i)
{
if(PlayerAfk[i] == 1)
{
SendClientMessage(COLOR_LIGHTBLUE,"--- Jogadores Away: -----");
format(string, sizeof(string), "JogadorID: %d.", i);
SendClientMessage(COLOR_WHITE, string);
return 1;
}
return 1;
}
}
Tenta isso
pawn Код:
|
new parafk;
new parafk[MAX_PLAYERS];
if(PlayerAfk[i] == 1)