Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- new bool:AFKv [MAX_PLAYERS];
- CMD:afk(playerid, params[])
- {
- if (APlayerData[playerid][LoggedIn] == false) return 0;
- if(PlayerInfo[playerid][NoEvento] == 1) return SendClientMessage(playerid, -1, "{FF0000}Você está num evento!");
- if (InCMEvent[playerid] == true) return SCM(playerid, 0xFF0000FF, "Você está em um evento!");
- if( GetPVarInt( playerid, "TempoComandoAFK" ) > GetTickCount() ) return SCM( playerid, -1, "{FF0000}Espere um pouco para usar novamente!" );
- SetPVarInt( playerid, "TempoComandoAFK", GetTickCount() + 10000 );
- APlayerData[playerid][TempoConectado] = false;
- if (AFKv[playerid] == false)
- {
- SCM(playerid, 0xFFFF00FF, "{FFFF00}Você está AFK! Use: {FFFFFF}/afksair{FFFF00} para voltar!");
- TogglePlayerControllable(playerid,0);
- AFKv[playerid] = true;
- new name[128];
- GetPlayerName(playerid,name,128);
- format(string1, sizeof(string1), "{FFFFFF}%s{FFFF00} está AFK!", name);
- SCMA(0xFFFF00FF, string1);
- }
- return 1;
- }
- CMD:afksair(playerid, params[])
- {
- if (APlayerData[playerid][LoggedIn] == false) return 0;
- if(PlayerInfo[playerid][NoEvento] == 1) return SendClientMessage(playerid, -1, "{FF0000}Você está num evento!");
- if (InCMEvent[playerid] == true) return SCM(playerid, 0xFF0000FF, "Você está em um evento!");
- if( GetPVarInt( playerid, "TempoComandoAFK" ) > GetTickCount() ) return SCM( playerid, -1, "{FF0000}Espere um pouco para usar novamente!" );
- SetPVarInt( playerid, "TempoComandoAFK", GetTickCount() + 10000 );
- APlayerData[playerid][TempoConectado] = 0;
- if (AFKv[playerid] == true)
- {
- AFKv[playerid] = false;
- TogglePlayerControllable(playerid,1);
- new name[128];
- GetPlayerName(playerid,name,128);
- format(string1, sizeof(string1), "{FFFFFF}%s{FFFF00} saiu do AFK!", name);
- SendClientMessageToAll(0xFFFF00FF, string1);
- }
- return 1;
- }
- CMD:ausentes(playerid){
- new mensagem2[128], nome[MAX_PLAYER_NAME];
- for (new i;i <MAX_PLAYERS; i++){
- if(AFKv[i] == true){
- GetPlayerName(i, nome, sizeof(nome));
- format(mensagem2, sizeof(mensagem2), "%s {FFA500}%s (id: {FFA500}%i{FFFFFF}) está {FFA500}ausente {FFFFFF}por: [{FFA500}%s{FFFFFF}]\n", mensagem2, nome, i, Convert(APlayerData[i][TempoConectado]));}}
- if (strlen(mensagem2) > 0)
- ShowPlayerDialog(playerid, adminsoff, DIALOG_STYLE_MSGBOX, "Jogadores ausentes:", mensagem2, "FECHAR", "");
- else
- SendClientMessage(playerid, 0xFF0000FF, "{FF0000}Não há jogadores ausentes.");
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment