CMD:afk(playerid, params []) { new string[129], pName[MAX_PLAYER_NAME]; GetPlayerName(playerid,pName,MAX_PLAYER_NAME); SendClientMessage(playerid, COLOR_WHITE, "You are now AFK."); format(string,sizeof string, "%s is now AFK (Away From Keyboard).",pName); SendClientMessageToAll(0xFF0000AA,string); TogglePlayerControllable(playerid, 0); return 1; } CMD:brb(playerid, params []) { new string[129], pName[MAX_PLAYER_NAME]; GetPlayerName(playerid,pName,MAX_PLAYER_NAME); SendClientMessage(playerid, COLOR_WHITE, "You are now BRB."); format(string,sizeof string, "%s is now BRB (Be Right Back).",pName); SendClientMessageToAll(0xFF0000AA,string); TogglePlayerControllable(playerid, 0); return 1; } CMD:back(playerid, params []) { new string[129], pName[MAX_PLAYER_NAME]; GetPlayerName(playerid,pName,MAX_PLAYER_NAME); SendClientMessage(playerid, COLOR_WHITE, "You are no longer AFK/BRB."); format(string,sizeof string, "%s is no longer AFK/BACK.",pName); SendClientMessageToAll(0xFF0000AA,string); TogglePlayerControllable(playerid, 1); return 1; }
CMD:listafk(playerid, params[]) {
if(PlayerInfo[playerid][pAdmin] >= 2) {
new
szMessage[36 + MAX_PLAYER_NAME];
SendClientMessageEx(playerid,COLOR_WHITE,"--[AFK PLAYERS]--");
foreach(Player, i) if(playerAFK[i] != 0 && playerAFKTime[i] > 15) {
format(szMessage,sizeof(szMessage),"* %s (ID %d), AFK for %d minutes.", GetPlayerNameEx(i), i, playerAFKTime[i] / 15);
if(PlayerInfo[i][pAdmin] >= 2) SendClientMessageEx(playerid,COLOR_RED,szMessage);
else SendClientMessageEx(playerid,COLOR_GREY,szMessage);
}
}
else SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use this command.");
return 1;
}
CMD:afk(playerid, params[], help)
{
new reason[64];
if(sscanf(params,"s[64]", reason)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /afk [reason]");
TogglePlayerControllable(playerid, 0);
new string[64], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
format(string, sizeof(string), "%s is now AFK Reason: %s.",pName, reason);
SendClientMessageToAll(0xFF0000AA,string);
return 1;
}
CMD:brb(playerid, params[], help)
{
new reason[64];
if(sscanf(params,"s[64]", reason)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /brb [reason]");
TogglePlayerControllable(playerid, 0);
new string[64], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
format(string, sizeof(string), "%s is now BRB Reason: %s.",pName, reason);
SendClientMessageToAll(0xFF0000AA,string);
return 1;
}
Sure, Here is the New Code for you bro <3
By the way, If you want i can make it with Label on your head also |
CMD:afk(playerid, params[], help)
{
new reason[64];
if(sscanf(params,"s[64]", reason)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /afk [reason]");
TogglePlayerControllable(playerid, 0);
new string[64], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
format(string, sizeof(string), "%s is now AFK Reason: %s.",pName, reason);
LabelOn[playerid] = Create3DTextLabel("I'm AFK (Away From Keyboard)",0xCCCC00FF,30.0,40.0,50.0,40.0,0);
Attach3DTextLabelToPlayer(afkbrb[playerid], playerid, 0.0, 0.0, 0.3);
SendClientMessageToAll(0xFF0000AA,string);
return 1;
}
CMD:brb(playerid, params[], help)
{
new reason[64];
if(sscanf(params,"s[64]", reason)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /brb [reason]");
TogglePlayerControllable(playerid, 0);
new string[64], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
format(string, sizeof(string), "%s is now BRB Reason: %s.",pName, reason);
LabelOn[playerid] = Create3DTextLabel("I'm BRB (Be Right Back)",0xCCCC00FF,30.0,40.0,50.0,40.0,0);
Attach3DTextLabelToPlayer(afkbrb[playerid], playerid, 0.0, 0.0, 0.3);
SendClientMessageToAll(0xFF0000AA,string);
return 1;
}
CMD:back(playerid, params [])
{
new string[129], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
SendClientMessage(playerid, COLOR_WHITE, "You are no longer AFK/BRB.");
format(string,sizeof string, "%s is no longer AFK/BACK.",pName);
SendClientMessageToAll(0xFF0000AA,string);
Delete3DTextLabel(afkbrb[playerid]);
TogglePlayerControllable(playerid, 1);
return 1;
}
Can you help me with add there /afklist.. Cmd... for see Who is afk?
|
excuse me! Look mine: https://sampforum.blast.hk/showthread.php?tid=332879
Same system and you have just remove (/AFK) take a look on mine! and i was firs upload it! |
excuse me! Look mine: https://sampforum.blast.hk/showthread.php?tid=332879
Same system and you have just remove (/AFK) take a look on mine! and i was firs upload it! |