Raised This Month: $ Target: $400
 0% 

grav


Post New Thread Reply   
 
Thread Tools Display Modes
hazard1337
Senior Member
Join Date: Sep 2006
Old 05-29-2008 , 14:00   Re: grav
Reply With Quote #11

Lemme look and see if I can find out whats wrong
Did you set the cvar for time to a float? (IE. 12.0)

Dekken what did you really change but adding a cvar for time?

PHP Code:
#include <amxmodx>

#define PLUGIN "Gravity Changer"
#define VERSION "1.0"
#define AUTHOR "Grim"


new Float:getthetime
new startgravityendgravtiypluginonsecondgravitybegingravity
new Float:timewait
new bool:roundstarted

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
pluginon register_cvar("amx_changegrav""1")
    
begingravity register_cvar("amx_begingrav""600")
    
secondgravity register_cvar("amx_secgrav""400")
    
timewait register_cvar("amx_gravitytime","25.0")
    
startgravity get_pcvar_num(begingravity)
    
getthetime get_pcvar_float(timewait)
    
endgravtiy get_pcvar_num(secondgravity)
    
    
register_event("HLTV","Round_Start","1=0","2=0")
    
register_event("HLTV"  ,"Round_End","1=0","2=0")
}

public 
Round_Start()
{
    if(
get_pcvar_num(pluginon) == 1)
    {
        
roundstarted true
        set_cvar_num
("sv_gravity %s"startgravity)
        
set_task(getthetime"setsecgrav")
    }
}

public 
Round_End()
{
    
roundstarted false
}

public 
setsecgrav()
{
    if(
get_pcvar_num(pluginon) == || roundstarted)
    {
        
set_cvar_num("sv_gravity %s"endgravtiy)
    }

Should work.
__________________
[IMG]http://img139.**************/img139/1530/2sejaewg1.gif[/IMG]
If you +/- my K, leave your name.
I do not take requests VIA PM
Click on this before requesting/suggesting
This is your best friend

Last edited by hazard1337; 05-29-2008 at 14:12.
hazard1337 is offline
Send a message via Skype™ to hazard1337
grimvh2
Veteran Member
Join Date: Nov 2007
Location: Fishdot Nation
Old 05-29-2008 , 14:29   Re: grav
Reply With Quote #12

2 Warnings when compilingen

20-21 Tag mismatch
22 - Tag mismatch
__________________
I am out of order!
grimvh2 is offline
dekken
Veteran Member
Join Date: Jul 2007
Old 05-29-2008 , 14:41   Re: grav
Reply With Quote #13

nothing..
i could actually rewrite it...but i was too lazy T_T
__________________
Signature Goes Here
dekken is offline
russek201
Junior Member
Join Date: May 2008
Old 05-29-2008 , 14:46   Re: grav
Reply With Quote #14

Quote:
Originally Posted by hazard1337 View Post
Lemme look and see if I can find out whats wrong
Did you set the cvar for time to a float? (IE. 12.0)

Dekken what did you really change but adding a cvar for time?

PHP Code:
#include <amxmodx>

#define PLUGIN "Gravity Changer"
#define VERSION "1.0"
#define AUTHOR "Grim"


new Float:getthetime
new startgravityendgravtiypluginonsecondgravitybegingravity
new Float:timewait
new bool:roundstarted

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
pluginon register_cvar("amx_changegrav""1")
    
begingravity register_cvar("amx_begingrav""600")
    
secondgravity register_cvar("amx_secgrav""400")
    
timewait register_cvar("amx_gravitytime","25.0")
    
startgravity get_pcvar_num(begingravity)
    
getthetime get_pcvar_float(timewait)
    
endgravtiy get_pcvar_num(secondgravity)
    
    
register_event("HLTV","Round_Start","1=0","2=0")
    
register_event("HLTV"  ,"Round_End","1=0","2=0")
}

public 
Round_Start()
{
    if(
get_pcvar_num(pluginon) == 1)
    {
        
roundstarted true
        set_cvar_num
("sv_gravity %s"startgravity)
        
set_task(getthetime"setsecgrav")
    }
}

public 
Round_End()
{
    
roundstarted false
}

public 
setsecgrav()
{
    if(
get_pcvar_num(pluginon) == || roundstarted)
    {
        
set_cvar_num("sv_gravity %s"endgravtiy)
    }

Should work.


this sux in amx menu it looks at working but no effect ;]
russek201 is offline
russek201
Junior Member
Join Date: May 2008
Old 05-29-2008 , 14:50   Re: grav
Reply With Quote #15

ok i have working version ^^
but can somone add to this plugin 2 hud messages ??
first when sets first grav
and second when sets sec grav ?
russek201 is offline
dekken
Veteran Member
Join Date: Jul 2007
Old 05-29-2008 , 15:42   Re: grav
Reply With Quote #16

show us the code..and i will add
__________________
Signature Goes Here
dekken is offline
russek201
Junior Member
Join Date: May 2008
Old 05-29-2008 , 16:52   Re: grav
Reply With Quote #17

Quote:
Originally Posted by dekken View Post
here..this one should work

PHP Code:
#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Gravity Changer"
#define VERSION "1.0"
#define AUTHOR "Grim"

#define timer 25.0

new Float:GetTheTime
new startGravityEndGravtiypluginonsecondgravitybegingravity
new timewait
new bool:roundstarted

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
pluginon register_cvar("amx_changegrav""1")
    
begingravity register_cvar("amx_begingrav""600")
    
secondgravity register_cvar("amx_secgrav""400")
    
timewait register_cvar("amx_gravitytime""25.0")
    
    
startGravity get_pcvar_num(begingravity)
    
GetTheTime get_pcvar_float(timewait)
    
EndGravtiy get_pcvar_num(secondgravity)
    
    
register_logevent("Round_Start"2"1=Round_Start")
    
register_logevent("EndRound"  ,2,"0=World triggered""1=Round_Draw""1=Round_End")
}

public 
Round_Start()
{
    if(
get_pcvar_num(pluginon) == 1)
    {
        
roundstarted true
        set_cvar_num
("sv_gravity"startGravity)
        
set_task(GetTheTime"setsecgrav")
    }
}

public 
EndRound()
{
    
roundstarted false
}

public 
setsecgrav()
{
    if(
get_pcvar_num(pluginon) == || roundstarted)
    {
        
set_cvar_num("sv_gravity"EndGravtiy)
    }

you also have a cvar to choose the time until it changes the Gravity..
amx_gravitytime
IT HAS TO BE A FLOAT...(0.1, 5.0, 6.3 ETC...)


this is sma ;]

when i change cvars they starts working after 2 h
russek201 is offline
hazard1337
Senior Member
Join Date: Sep 2006
Old 05-29-2008 , 19:06   Re: grav
Reply With Quote #18

Quote:
Originally Posted by grimvh2 View Post
2 Warnings when compilingen

20-21 Tag mismatch
22 - Tag mismatch
Yea I couldn't quite figure out what was wrong...it looked fine to me.

BTW I just cleaned up / fixed bugs on his code normally.

Ex. He wasn't putting the float cvar for the time limit to a float, which is probably why it wasn't working
__________________
[IMG]http://img139.**************/img139/1530/2sejaewg1.gif[/IMG]
If you +/- my K, leave your name.
I do not take requests VIA PM
Click on this before requesting/suggesting
This is your best friend

Last edited by hazard1337; 05-29-2008 at 23:47.
hazard1337 is offline
Send a message via Skype™ to hazard1337
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 02:31.


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