Advertisement
Guest User

Wolf

a guest
Jan 25th, 2010
865
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 2.30 KB | None | 0 0
  1. // By GROVE4L
  2. // www.pawnoscripting.com
  3.  
  4. #include <a_samp>
  5.  
  6. #define COLOR_ROJO 0xFF0000FF
  7. #define COLOR_VERDE 0x00A200FF
  8. #define COLOR_AZUL 0x0000DAFF
  9.  
  10. enum Info
  11. {
  12.     AFK,
  13.     SHH,
  14. };
  15. new Informacion[MAX_PLAYERS][Info];
  16. new Float:VidaP[MAX_PLAYERS];
  17. new Float:Chaleco[MAX_PLAYERS];
  18. new Nombre[MAX_PLAYER_NAME];
  19.  
  20. public OnPlayerCommandText(playerid, cmdtext[])
  21. {
  22.     if (strcmp("/afk", cmdtext, true) == 0)
  23.     {
  24.         if(Informacion[playerid][AFK] == 0)
  25.         {
  26.             GetPlayerArmour(playerid,Chaleco[playerid]);
  27.             GetPlayerHealth(playerid,VidaP[playerid]);
  28.             new string[256];
  29.             new sendername[MAX_PLAYER_NAME];
  30.            
  31.             GetPlayerName(playerid, Nombre, sizeof(Nombre));
  32.             GetPlayerName(playerid, sendername, sizeof(sendername));
  33.             format(string, sizeof(string), "* %s esta ahora en modo AFK.", sendername);
  34.             SendClientMessageToAll(COLOR_VERDE, string);
  35.             format(string, sizeof(string), "[AFK]%s", sendername);
  36.             SetPlayerName(playerid,string);
  37.             TogglePlayerControllable(playerid, 0);
  38.             SetPlayerHealth(playerid, 999999999);
  39.             SetPlayerArmour(playerid, 999999999);
  40.             Informacion[playerid][AFK] = 1;
  41.             Informacion[playerid][SHH] = 1;
  42.             return 1;
  43.         }
  44.         else
  45.         {
  46.         SendClientMessage(playerid, COLOR_ROJO, "Ya estas en modo AFK!");
  47.         return 1;
  48.         }
  49.     }
  50.     if (strcmp("/salirafk", cmdtext, true) == 0)
  51.     {
  52.         if(Informacion[playerid][AFK] == 1)
  53.         {
  54.             TogglePlayerControllable(playerid,1);
  55.             SetPlayerArmour(playerid,Chaleco[playerid]);
  56.             SetPlayerHealth(playerid,VidaP[playerid]);
  57.             Informacion[playerid][AFK] = 0;
  58.             Informacion[playerid][SHH] = 0;
  59.             new string[256];
  60.             new sendername[MAX_PLAYER_NAME];
  61.             format(string, sizeof(string), "%s",Nombre);
  62.             SetPlayerName(playerid,string);
  63.             GetPlayerName(playerid, sendername, sizeof(sendername));
  64.             format(string, sizeof(string), "* %s ha salido del modo AFK.", sendername);
  65.             SendClientMessageToAll(COLOR_AZUL, string);
  66.             return 1;
  67.         }
  68.         else
  69.         {
  70.         SendClientMessage(playerid, COLOR_ROJO, "No estas en modo AFK!");
  71.         return 1;
  72.         }
  73.     }
  74.  
  75.     return 0;
  76. }
  77.  
  78. public OnPlayerText(playerid, text[])
  79. {
  80.     if(Informacion[playerid][SHH] == 1)
  81.     {
  82.         SendClientMessage(playerid,COLOR_ROJO,"Estas AFK, no puedes hablar!");
  83.         return 0;
  84.     }
  85.     return 1;
  86. }
  87.  
  88. // By GROVE4L
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement