new IsAFK[MAX_PLAYERS];
COMMAND:afklist(playerid,params[])
new Msg[128], Afkname[24];
{
format(Msg, 128, "{FF6600}s%", Afkname[24]); // the guy who is AFK.
SendClientMessage(playerid, 0xFFFFFFFF, "People who are AFK:")
SendClientMessage(playerid, 0xFFFFFFFF, Msg)
}
COMMAND:afklist(playerid,params[])
new Msg[128], Afkname[24];
{
format(Msg, 128, "{FF6600}%s is now AFK", Afkname[24]); // the guy who is AFK.
SendClientMessage(playerid, 0xFFFFFFFF, Msg)
}
command(afklist, playerid, params)
{
new pString[MAX_PLAYER_NAME], pName[MAX_PLAYER_NAME];
for(new pID = 0; pID < MAX_PLAYERS; pID ++)
{
if(IsPlayerConnected(pID)
{
if(IsPlayerAFK[pID] == 1)
{
SendClientMessage(playerid, 0xFFFFFFFF, "Players on AFK");
GetPlayerName(playerid, pName, sizeof(pName));
format(pString, sizeof(pString), "%s" pName);
SendClientMessage(playerid, 0xFFFFFFFF, pString);
}
}
}
return 1;
}
CMD:afklist(playerid)
{
new pString[MAX_PLAYER_NAME + 2];
new pName[MAX_PLAYER_NAME];
SendClientMessage(playerid, 0xFFFF00AA, "|_____AFK Players_____|");
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i)
{
if(IsAFK[i] == 1)
{
GetPlayerName(i, pName, sizeof(pName));
format(pString, sizeof(pString), "> %s" pName);
SendClientMessage(playerid, 0xFFFFFFAA, pString);
}
}
}
return 1;
}
|
untested, but I see no reason this shoudn't work
pawn Код:
|