Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Plugin generated by AMXX-Studio */
- #include <amxmodx>
- #include <amxmisc>
- #include <cstrike>
- #define PLUGIN "reviveme"
- #define VERSION "1.0"
- #define AUTHOR "SoulSlayeR"
- new bool:reviveMeCd[33]=false;
- new szMsg[9];
- new Timer[33] = 0;
- public plugin_init() {
- register_plugin(PLUGIN, VERSION, AUTHOR)
- register_clcmd("say", "reviveMeFunc");
- }
- public reviveMeFunc(id)
- {
- read_argv(id,szMsg,8);
- if(equali(szMsg , "reviveme"))
- {
- if(!is_user_alive(id))
- {
- if(cs_get_user_team(id) == CS_TEAM_T)
- {
- if(reviveMeCd[id] == false)
- {
- new reviveMeChance = random_num(1,10);
- switch(reviveMeChance)
- {
- case 1..2:
- {
- server_cmd( "amx_revive %s", fnGetName( id ) );
- client_print(id,print_chat,"Nice, u got revived");
- Timer[id] = 120;
- reviveMeCd[id] = true;
- reviveMeCdOn(id)
- }
- case 3..10:
- {
- client_print(id,print_chat,"U didnt get revive , try again in 120Sec");
- Timer[id] = 120;
- reviveMeCd[id] = true;
- reviveMeCdOn(id)
- }
- }
- }
- else
- {
- client_print(id,print_chat, "U must wait %d Seconds before using again the reviveme command",Timer[id]);
- return PLUGIN_CONTINUE
- }
- }
- else
- {
- client_print(id,print_chat, "U Must Be A Terror To Use This Commands");
- }
- }
- else
- {
- client_print(id,print_chat, "U Must Be Dead To Use This Command");
- }
- }
- else
- {
- return PLUGIN_CONTINUE
- }
- return PLUGIN_CONTINUE
- }
- stock fnGetName(id)
- {
- static userName[33];
- get_user_name( id, userName, 32 )
- return userName;
- }
- public reviveMeCdOn(id)
- {
- if(Timer[id] > 0)
- {
- Timer[id]--
- set_task( 1.0, "reviveMeCdOn",id);
- }
- if(Timer[id] <= 0)
- {
- client_print(id,print_chat,"U can now use again the reviveme gamble");
- Timer[id] = 120;
- reviveMeCd[id] = false;
- return PLUGIN_CONTINUE
- }
- return PLUGIN_CONTINUE
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement