Advertisement
Guest User

reviveme

a guest
Sep 28th, 2013
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.91 KB | None | 0 0
  1. /* Plugin generated by AMXX-Studio */
  2.  
  3. #include <amxmodx>
  4. #include <amxmisc>
  5. #include <cstrike>
  6.  
  7. #define PLUGIN "reviveme"
  8. #define VERSION "1.0"
  9. #define AUTHOR "SoulSlayeR"
  10.  
  11. new bool:reviveMeCd[33]=false;
  12. new szMsg[9];
  13. new Timer[33] = 0;
  14.  
  15. public plugin_init() {
  16.     register_plugin(PLUGIN, VERSION, AUTHOR)
  17.     register_clcmd("say", "reviveMeFunc");
  18. }
  19.  
  20. public reviveMeFunc(id)
  21. {
  22.     read_argv(id,szMsg,8);
  23.     if(equali(szMsg , "reviveme"))
  24.     {
  25.         if(!is_user_alive(id))
  26.         {
  27.             if(cs_get_user_team(id) == CS_TEAM_T)
  28.             {
  29.                 if(reviveMeCd[id] == false)
  30.                 {
  31.                     new reviveMeChance = random_num(1,10);
  32.                     switch(reviveMeChance)
  33.                     {
  34.                         case 1..2:
  35.                         {
  36.                             server_cmd( "amx_revive %s", fnGetName( id ) );
  37.                             client_print(id,print_chat,"Nice, u got revived");
  38.                             Timer[id] = 120;
  39.                             reviveMeCd[id] = true;
  40.                             reviveMeCdOn(id)
  41.                         }
  42.                         case 3..10:
  43.                         {
  44.                             client_print(id,print_chat,"U didnt get revive , try again in 120Sec");
  45.                             Timer[id] = 120;
  46.                             reviveMeCd[id] = true;
  47.                             reviveMeCdOn(id)
  48.                         }
  49.                     }
  50.                 }
  51.                 else
  52.                 {
  53.                     client_print(id,print_chat, "U must wait %d Seconds before using again the reviveme command",Timer[id]);
  54.                     return PLUGIN_CONTINUE
  55.                 }
  56.             }
  57.             else
  58.             {
  59.                 client_print(id,print_chat, "U Must Be A Terror To Use This Commands");
  60.             }
  61.         }
  62.         else
  63.         {
  64.             client_print(id,print_chat, "U Must Be Dead To Use This Command");
  65.         }
  66.     }
  67.     else
  68.     {
  69.         return PLUGIN_CONTINUE
  70.     }
  71.     return PLUGIN_CONTINUE
  72. }
  73.  
  74. stock fnGetName(id)
  75. {
  76.     static userName[33];
  77.     get_user_name( id, userName, 32 )
  78.     return userName;
  79. }
  80. public reviveMeCdOn(id)
  81. {
  82.     if(Timer[id] > 0)
  83.     {
  84.         Timer[id]--
  85.         set_task( 1.0, "reviveMeCdOn",id);
  86.     }
  87.     if(Timer[id] <= 0)
  88.     {
  89.         client_print(id,print_chat,"U can now use again the reviveme gamble");
  90.         Timer[id] = 120;
  91.         reviveMeCd[id] = false;
  92.         return PLUGIN_CONTINUE
  93.     }
  94.     return PLUGIN_CONTINUE
  95. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement