ocmd:afk(playerid,params[])
{
if(!IsPlayerConnected(playerid))return SendClientMessage(playerid,cool,"Du musst eingeloggt sein um AFK zu gehen!");
new afk[128], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid,pname,sizeof(pname));
format(afk,sizeof(afk),"%s ist in den AFK-Modus gegangen!",pname);
SendClientMessageToAll(cool,afk);
TogglePlayerControllable(playerid,0);
SendClientMessage(playerid,cool,"Du bist in den AFK-Modus gegangen!");// 1. playerid
SetPVarInt(playerid,"AFK",1);// 2. playerid
return 1;
}
ocmd:back(playerid,params[])
{
if(!IsPlayerConnected(playerid))return SendClientMessage(playerid,cool,"Du bist nicht eingeloggt!");
new afk[128], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid,pname,sizeof(pname));
format(afk,sizeof(afk),"%s ist wieder da!",pname);
SendClientMessageToAll(cool,afk);
TogglePlayerControllable(playerid,1);
SendClientMessage(playerid,cool,"Du bist zurück!");// 3. playerid
SetPVarInt(playerid,"AFK",0);// 4. playerid
return 1;
}
ocmd:afkliste(playerid,params[])
{
if(!IsPlayerConnected(playerid))return SendClientMessage(playerid,cool,"Du musst eingeloggt sein um die /afkliste aufzurufen!");
SendClientMessage(playerid,Tuerkis,"AFK Spieler:");
new aname[256], string[128];// 2. Warning
for(new i = 0; i < MAX_PLAYERS; i++)// 1. Warning
{
if(IsPlayerConnected(i))
{
if(GetPVarInt(playerid,"AFK")==1)// 5. playerid
{
GetPlayerName(i, aname, sizeof(aname));
format(string, 256, "%s", aname);
SendClientMessage(playerid, cool, string);
return 1;
}
}
}
return 1;
}