Raised This Month: $ Target: $400
 0% 

function inb?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Burnzy
Veteran Member
Join Date: Apr 2004
Old 07-10-2004 , 19:38  
Reply With Quote #4

Code:
#include <amxmodx> #include <amxmisc> #include <fun> #define NEG_GRAV                -50.0 #define CRUSH_GRAV       999999999.0 #define DELAY                    1.0 #define RISE_TIME                3.0 #define FALL_TIME                4.0 #define SMALL_JUMP              15 new Float:old_grav          // to remember old grav setting new bool:is_in_progress     // to know if there is a crush in progress new thePlayers[32], nb      // to remember which players are being crushed public grav_crush(id,level,cid) {     // check access rights     if (!cmd_access(id,level,cid,1))         return PLUGIN_HANDLED     // check if there is already a crush     if (is_in_progress)     {         console_print(id,"There is already a crush in progress.")         return PLUGIN_HANDLED     }     // send hud warning     is_in_progress = true     show_hudmessage(0, "Now, you will all be crushed !")     // support for amx_show_activity     switch (get_cvar_num("amx_show_activity"))     {     case 1 :         client_print(0, print_chat, "ADMIN has launched a gravity crush !")     case 2 :         {             new name[32]             get_user_name(id, name, 31)             client_print(0, print_chat, "ADMIN %s has launched a gravity crush !", name)         }     }     // set all tasks     set_task(DELAY, "begin_jump")     set_task(DELAY + RISE_TIME, "reverse_grav")     set_task(DELAY + FALL_TIME, "restore_grav")     return PLUGIN_HANDLED } public begin_jump() {     // change gravity     old_grav = get_cvar_float("sv_gravity")     set_cvar_float("sv_gravity", NEG_GRAV)     // make all alive players jump     get_players(thePlayers,nb,"a")     new origin[3]     for(new i=0; i<nb; ++i)     {         get_user_origin(thePlayers[i], origin)         origin[2] += SMALL_JUMP         set_user_origin(thePlayers[i], origin)     }         return PLUGIN_HANDLED } public reverse_grav() {     // reverse gravity     set_cvar_float("sv_gravity", CRUSH_GRAV)     // set all immune alive players in godmode     get_players(thePlayers,nb,"a")       for(new i=0; inb; ++i)         if (get_user_flags(thePlayers[i])&ADMIN_IMMUNITY)                   set_user_godmode(thePlayers[i],1)     return PLUGIN_HANDLED } public restore_grav() {     // restore gravity     set_cvar_float("sv_gravity", old_grav)     // remove godmode for everyone     get_players(thePlayers,nb)       for(new i=0; inb; ++i)         if (get_user_godmode(thePlayers[i]))                    set_user_godmode(thePlayers[i])     is_in_progress = false     return PLUGIN_HANDLED } public plugin_init() {     register_plugin("Gravity Crush","1.0","Vince1")     register_concmd("amx_gravity_crush","grav_crush",ADMIN_SLAY)     is_in_progress = false     return PLUGIN_CONTINUE }
__________________
Burnzy is offline
Send a message via AIM to Burnzy
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 14:43.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode