Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // By GROVE4L
- // www.pawnoscripting.com
- #include <a_samp>
- #define COLOR_ROJO 0xFF0000FF
- #define COLOR_VERDE 0x00A200FF
- #define COLOR_AZUL 0x0000DAFF
- enum Info
- {
- AFK,
- SHH,
- };
- new Informacion[MAX_PLAYERS][Info];
- new Float:VidaP[MAX_PLAYERS];
- new Float:Chaleco[MAX_PLAYERS];
- new Nombre[MAX_PLAYER_NAME];
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if (strcmp("/afk", cmdtext, true) == 0)
- {
- if(Informacion[playerid][AFK] == 0)
- {
- GetPlayerArmour(playerid,Chaleco[playerid]);
- GetPlayerHealth(playerid,VidaP[playerid]);
- new string[256];
- new sendername[MAX_PLAYER_NAME];
- GetPlayerName(playerid, Nombre, sizeof(Nombre));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- format(string, sizeof(string), "* %s esta ahora en modo AFK.", sendername);
- SendClientMessageToAll(COLOR_VERDE, string);
- format(string, sizeof(string), "[AFK]%s", sendername);
- SetPlayerName(playerid,string);
- TogglePlayerControllable(playerid, 0);
- SetPlayerHealth(playerid, 999999999);
- SetPlayerArmour(playerid, 999999999);
- Informacion[playerid][AFK] = 1;
- Informacion[playerid][SHH] = 1;
- return 1;
- }
- else
- {
- SendClientMessage(playerid, COLOR_ROJO, "Ya estas en modo AFK!");
- return 1;
- }
- }
- if (strcmp("/salirafk", cmdtext, true) == 0)
- {
- if(Informacion[playerid][AFK] == 1)
- {
- TogglePlayerControllable(playerid,1);
- SetPlayerArmour(playerid,Chaleco[playerid]);
- SetPlayerHealth(playerid,VidaP[playerid]);
- Informacion[playerid][AFK] = 0;
- Informacion[playerid][SHH] = 0;
- new string[256];
- new sendername[MAX_PLAYER_NAME];
- format(string, sizeof(string), "%s",Nombre);
- SetPlayerName(playerid,string);
- GetPlayerName(playerid, sendername, sizeof(sendername));
- format(string, sizeof(string), "* %s ha salido del modo AFK.", sendername);
- SendClientMessageToAll(COLOR_AZUL, string);
- return 1;
- }
- else
- {
- SendClientMessage(playerid, COLOR_ROJO, "No estas en modo AFK!");
- return 1;
- }
- }
- return 0;
- }
- public OnPlayerText(playerid, text[])
- {
- if(Informacion[playerid][SHH] == 1)
- {
- SendClientMessage(playerid,COLOR_ROJO,"Estas AFK, no puedes hablar!");
- return 0;
- }
- return 1;
- }
- // By GROVE4L
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement