Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- ______________________________
- | System AFK Dialog [Motivo] |
- | By - @Riichard (OwnPlaay) |
- | Não Retire os Creditos! |
- |______________________________|
- */
- #include < a_samp >
- #define SystemAFK 420 // ID Já Usada? Modifique.
- #define Vermelho 0xFF0000AA
- #define Amarelo 0xFFFF28AA
- new Afk[MAX_PLAYERS];
- // ======= [ AFK ] ======= //
- #if defined FILTERSCRIPT
- public OnFilterScriptInit() {
- print("\n AFK Em Dialog + Motivo - @Riichard");
- return 1;
- }
- #else
- #endif
- // Entrou AFK
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) {
- if (dialogid == SystemAFK) {
- if (response) {
- new Float: X,
- Float: Y,
- Float: Z;
- new str[200];
- GetPlayerName(playerid, str, sizeof(str));
- format(str, sizeof(str), "{41FF20}%s(ID:%d){9C9C9C} » Entrou em Modo {41FF20}(AFK/Ausente) {9C9C9C}[Motivo: %s]", str, playerid, inputtext[0]);
- SendClientMessageToAll(-1, str);
- SendClientMessageToAll(0x9C9C9CAA, "Vejá quem está em Modo Ausente/AFK » {FFFF00}/AFKs");
- TogglePlayerControllable(playerid, 0);
- SetPlayerHealth(playerid, 99999999.9);
- SetCameraBehindPlayer(playerid);
- GetPlayerPos(playerid, X, Y, Z);
- SetPlayerPos(playerid, X, Y, Z + 80);
- SendClientMessage(playerid, 0x20B2AAAA, "Você entrou em Modo Ausente. Use : /On,/Online ou /Voltar.");
- }
- }
- return 1;
- }
- // Connect Mensagem FS
- public OnPlayerConnect(playerid) {
- SendClientMessage(playerid, Amarelo, "» Sistema AFK em Dialog + Motivo. /AFK /AUSENTE");
- Afk[playerid] = 0;
- return 1;
- }
- // Comando AFK
- public OnPlayerCommandText(playerid, cmdtext[]) {
- // Online - ON
- if (!strcmp(cmdtext, "/on", true) || !strcmp(cmdtext, "/voltar", true) || !strcmp(cmdtext, "/online", true)) {
- if (Afk[playerid] == 1) {
- Afk[playerid] = 0;
- new str[200];
- GetPlayerName(playerid, str, sizeof(str));
- format(str, sizeof(str), "{41FF20}%s(ID:%d){9C9C9C} » Saiu do Modo {41FF20}(AFK/Ausente)", str, playerid);
- SendClientMessageToAll(-1, str);
- new Float: X,
- Float: Y,
- Float: Z;
- TogglePlayerControllable(playerid, 1);
- SetPlayerHealth(playerid, 100.0);
- GetPlayerPos(playerid, X, Y, Z);
- SetPlayerPos(playerid, X, Y, Z - 80);
- SendClientMessage(playerid, 0x00FF7FAA, "Bem Vindo de Volta :)");
- } else {
- SendClientMessage(playerid, Vermelho, "[FAIL] » Você não Está Ausente ");
- return 1;
- }
- return 1;
- }
- // AFK - Ausente
- if (!strcmp(cmdtext, "/afk", true) || !strcmp(cmdtext, "/aus", true) || !strcmp(cmdtext, "/ausente", true)) {
- if (Afk[playerid] == 0) {
- Afk[playerid] = 1;
- ShowPlayerDialog(playerid, SystemAFK, DIALOG_STYLE_INPUT, "» AFK System V1", "Porque Motivo Vai Ficar Ausente:", "Ausentar", "Cancelar");
- } else {
- SendClientMessage(playerid, Vermelho, "[FAIL] » Você ja Está Ausente ");
- return 1;
- }
- return 1;
- }
- if (strcmp("/AFKs", cmdtext, true, 10) == 0) {
- SendClientMessage(playerid, -1, "{696969}______[ {00CED1}Jogadores Ausente {696969}]______");
- for (new i = 0; i < MAX_PLAYERS; i++) {
- if (IsPlayerConnected(i)) {
- if (Afk[i] == 1) {
- new Name[24];
- new String1[258];
- GetPlayerName(i, Name, sizeof(Name));
- format(String1, 256, "{696969}Player : {00CED1}%s(ID:%d)", Name, playerid);
- SendClientMessage(playerid, -1, String1);
- }
- }
- }
- return 1;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement