Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #define Vermelho 0xFF0000AA
- #define Amarelo 0xFFFF00AA
- new
- SistemaAFK[MAX_PLAYERS],
- Nome[30],
- PegarNome[MAX_PLAYERS],
- pNameOriginal[MAX_PLAYERS][MAX_PLAYER_NAME],
- Text:Text,Text:textoafk
- ;
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if(SistemaAFK[playerid] == 1 && strcmp(cmdtext,"/AFK", true) != 0) return SendClientMessage(playerid,Vermelho,"Você não pode falar e nem digitar comand enquanto estiver AFK!");
- if(strcmp(cmdtext,"/AFK", true) == 0)
- {
- if(SistemaAFK[playerid] == 0)
- {
- SistemaAFK[playerid] = 1;
- TogglePlayerControllable(playerid, 0);
- TextDrawShowForPlayer(playerid,Text);
- TextDrawShowForPlayer(playerid,textoafk);
- PegarNome[playerid] = GetPlayerName(playerid, Nome, sizeof(Nome));
- SendClientMessage(playerid,Amarelo,"Você está em AFK, e não pode digitar nenhum comando e nem falar.");
- GetPlayerName(playerid, pNameOriginal[playerid], sizeof pNameOriginal);
- new nometemp[MAX_PLAYER_NAME];
- format(nometemp, sizeof nometemp, "[AFK]%s", pNameOriginal[playerid]);
- SetPlayerName(playerid, nometemp);
- new string[128];
- format(string, sizeof string,"%s está em modo AFK! ( /AFK )",nometemp);SendClientMessageToAll(Amarelo,string);
- SetPlayerVirtualWorld(playerid, 5);//
- }
- else if(SistemaAFK[playerid] == 1)
- {
- SistemaAFK[playerid] = 0;
- TogglePlayerControllable(playerid, 1);
- TextDrawHideForPlayer(playerid,Text);
- TextDrawHideForPlayer(playerid,textoafk);
- SetPlayerName(playerid,PegarNome[playerid]);
- SendClientMessage(playerid,Amarelo,"Você saiu do AFK,poriso Está Livre Para Jogar :D");
- new string[128];
- SetPlayerName(playerid, pNameOriginal[playerid]);
- format(string, sizeof string,"%s saiu do modo AFK, pode mata-lo ( /AFK ).",pNameOriginal[playerid]);SendClientMessageToAll(Amarelo,string);
- SetPlayerVirtualWorld(playerid, 0);//
- }
- return 1;
- }
- return 0;
- }
- public OnPlayerText(playerid, text[])
- {
- if(SistemaAFK[playerid] == 1)
- {
- SendClientMessage(playerid,Vermelho," Você não pode falar em quanto tiver em AFK, Digite /AFK novamente para sair");
- return 0;
- }
- return 1;
- }
- public OnGameModeInit()
- {
- Text = TextDrawCreate(0,0,"~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~");
- TextDrawUseBox(Text, 1);
- TextDrawBoxColor(Text, 0x2E2E2E55);
- textoafk = TextDrawCreate(46.000000, 170.000000, "Para Sair AFK digite /AFK novamente.~n~emquando estiver AFK, nao podera digitar comandos e~n~ nem falar");
- TextDrawBackgroundColor(textoafk, -16776961);
- TextDrawFont(textoafk, 1);
- TextDrawLetterSize(textoafk, 0.519999, 2.000000);
- TextDrawColor(textoafk, 255);
- TextDrawSetOutline(textoafk, 1);
- TextDrawSetProportional(textoafk, 1);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment