Raised This Month: $ Target: $400
 0% 

/ungrav


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
KingCommentor
Senior Member
Join Date: Jan 2008
Location: Floridaaaa
Old 08-01-2008 , 23:18   /ungrav
Reply With Quote #1

I wrote a small script to let a user buy lower gravity, is there a command to change it back to normal?

By saying /ungrav
__________________
+Karma is appreciated! |Be PROUD, leave your name!
KingCommentor is offline
Send a message via AIM to KingCommentor
jim_yang
Veteran Member
Join Date: Aug 2006
Old 08-01-2008 , 23:24   Re: /ungrav
Reply With Quote #2

set_user_gravity(id)
__________________
Project : CSDM all in one - 99%
<team balancer#no round end#entity remover#quake sounds#fake full#maps management menu#players punishment menu#no team flash#colored flashbang#grenade trails#HE effect#spawn protection#weapon arena#weapon upgrade#auto join#no weapon drop#one name>
jim_yang is offline
iHaxor.Stan
BANNED
Join Date: Jul 2007
Old 08-01-2008 , 23:26   Re: /ungrav
Reply With Quote #3

the same way you set it to low gravity, but instead of say "0.25" or something, set the number to 1 so it's 800 gravity.
iHaxor.Stan is offline
KingCommentor
Senior Member
Join Date: Jan 2008
Location: Floridaaaa
Old 08-01-2008 , 23:44   Re: /ungrav
Reply With Quote #4

New to scripting, starting off small, kinda like this?

PHP Code:
#include <amxmodx> 
#include <amxmisc> 
#include <cstrike> 
#include <fakemeta> 
#define PLUGIN "TESTING" 
#define VERSION "1.0" 
#define AUTHOR "kingcommentor" 
new price 
new enabled 
new g_MsgSync 
public plugin_init() 

 
register_plugin(PLUGINVERSIONAUTHOR
 
register_clcmd("say /grav","GravOn"
 
register_clcmd("say /ungrav","GravOff"
 
price register_cvar("amx_grav_price""1000"
 
enabled register_cvar("amx_grav_enabled""1"
 
g_MsgSync CreateHudSyncObj() 

public 
GravOn(id

 new 
money cs_get_user_money(id
 new 
tprice get_pcvar_num(price); 
 if (
get_pcvar_num(enabled) == 1
 { 
  if (
money tprice
  { 
   
client_print(id,print_chat,"You don't have enough money! Gravity currently costs %d!" tprice
  } 
  else 
  { 
   
set_hudmessage(01272550.300.2906.0,15.0
   
ShowSyncHudMsg(idg_MsgSync,"Your gravity is now 400"
   
set_pev(idpev_gravity0.50
   
cs_set_user_money(idmoney-tprice
  } 
 } 

public 
GravOff(id)
 {
 
set_user_gravity(id1)
 
set_hudmessage(01272550.300.2906.0,15.0
 
ShowSyncHudMsg(idg_MsgSync,"Your gravity is not back to normal")

__________________
+Karma is appreciated! |Be PROUD, leave your name!
KingCommentor is offline
Send a message via AIM to KingCommentor
jim_yang
Veteran Member
Join Date: Aug 2006
Old 08-01-2008 , 23:46   Re: /ungrav
Reply With Quote #5

you need to include fun module to use the native
set_user_gravity(id)
1.0 is default value of the 2nd param

fakemeta way is set_pev(id, pev_gravity, 1.0)
__________________
Project : CSDM all in one - 99%
<team balancer#no round end#entity remover#quake sounds#fake full#maps management menu#players punishment menu#no team flash#colored flashbang#grenade trails#HE effect#spawn protection#weapon arena#weapon upgrade#auto join#no weapon drop#one name>
jim_yang is offline
KingCommentor
Senior Member
Join Date: Jan 2008
Location: Floridaaaa
Old 08-01-2008 , 23:53   Re: /ungrav
Reply With Quote #6

How do I make scrolling message every, say .. 5 minutes?
__________________
+Karma is appreciated! |Be PROUD, leave your name!

Last edited by KingCommentor; 08-02-2008 at 01:02.
KingCommentor is offline
Send a message via AIM to KingCommentor
grimvh2
Veteran Member
Join Date: Nov 2007
Location: Fishdot Nation
Old 08-02-2008 , 08:17   Re: /ungrav
Reply With Quote #7

maybe instead of making them say /ungrav take away gravity after the round ends

PHP Code:
#include <amxmodx> 
#include <amxmisc> 
#include <cstrike> 
#include <fakemeta> 
#define PLUGIN "TESTING" 
#define VERSION "1.0" 
#define AUTHOR "kingcommentor" 
new price 
new enabled 
new g_MsgSync 
public plugin_init() 

 
register_plugin(PLUGINVERSIONAUTHOR
 
register_clcmd("say /grav","GravOn")
 
register_logevent("EndRound",2,"0=World triggered""1=Round_Draw""1=Round_End");
 
price register_cvar("amx_grav_price""1000"
 
enabled register_cvar("amx_grav_enabled""1"
 
g_MsgSync CreateHudSyncObj() 

public 
GravOn(id

 new 
money cs_get_user_money(id
 new 
tprice get_pcvar_num(price); 
 if (
get_pcvar_num(enabled) == 1
 { 
  if (
money tprice
  { 
   
client_print(id,print_chat,"You don't have enough money! Gravity currently costs %d!" tprice
  } 
  else 
  { 
   
set_hudmessage(01272550.300.2906.0,15.0
   
ShowSyncHudMsg(idg_MsgSync,"Your gravity is now 400 untill the round ends"
   
set_pev(idpev_gravity0.50
   
cs_set_user_money(idmoney-tprice
  } 
 } 


/* Round Ends */
public EndRound()
{
    new 
players[32], pnum
    get_players
(playerspnum)
    for( new 
0pnumi++ )
    {
        
set_pev(players[i], pev_gravity1.0)
    }    

__________________
I am out of order!
grimvh2 is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 08-02-2008 , 13:49   Re: /ungrav
Reply With Quote #8

add to plugin_init();
PHP Code:
set_task(520.0"GravADS"
PHP Code:
public GravADS() {
  
// ads code bla bla

set_task(520.0"GravADS")

xPaw is offline
KingCommentor
Senior Member
Join Date: Jan 2008
Location: Floridaaaa
Old 08-02-2008 , 16:54   Re: /ungrav
Reply With Quote #9

It automatically is removed at round end for some reason, I never added anything to make it do such a thing.
__________________
+Karma is appreciated! |Be PROUD, leave your name!
KingCommentor is offline
Send a message via AIM to KingCommentor
iHaxor.Stan
BANNED
Join Date: Jul 2007
Old 08-02-2008 , 19:09   Re: /ungrav
Reply With Quote #10

That's because it just does that. You have to set it on every round start if you don't want that to happen.
iHaxor.Stan is offline
Reply



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 23:08.


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