Ez viszont nem lesz jó, mert ha valaki afkba lép, bárki ki tud lépni belõle
[pawn]#include <a_samp>
#define COLOR_RED 0xFF0000FF
#define PLAYERS 50 // Férõhelyek számára írd át
new bool:afkstatus[PLAYERS]=false;
public OnPlayerCommandText(playerid, cmdtext[ ])
{
if (strcmp(cmdtext,\"/afk\", true))
{
if( !afkstatus[playerid] )
{
TogglePlayerControllable(playerid,false);
SendClientMessage(playerid, COLOR_RED, \"AFK-BE\");
SetPlayerVirtualWorld(playerid, 1);
afkstatus[playerid]=true;
}
else if( afkstatus )
{
TogglePlayerControllable(playerid,true);
SendClientMessage(playerid, COLOR_RED, \"AFK-KI\");
SetPlayerVirtualWorld(playerid, 0);
afkstatus[playerid]=false;
}
return 1;
}
return 0;
}
[/pawn]