Raised This Month: $ Target: $400
 0% 

define/register_cvar


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 04-02-2009 , 13:16   define/register_cvar
Reply With Quote #1

Hi,

idk why this not works. i have a cvar like :

PHP Code:
register_cvar("my_speed","2.0")

speed 320.0 get_cvar_float("my_speed"
but i dont wanna to have a cvar. so i tried to change this to :

PHP Code:
#define my_speed 2.0


speed 320.0 my_speed 
problem :

player get speed over 1500 i thinked so the speed must be 640 or not ?this all are the same or not???
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 04-02-2009 , 14:38   Re: define/register_cvar
Reply With Quote #2

i'm not sure but try
PHP Code:
#define MY_SPEED 2

new Float:iSpeed = ( 320.0 float(MY_SPEED) ); 
__________________
xPaw is offline
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 04-02-2009 , 14:53   Re: define/register_cvar
Reply With Quote #3

Show the full code
__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.
ot_207 is offline
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 04-02-2009 , 15:00   Re: define/register_cvar
Reply With Quote #4

TY xpaw, ill try it & say if this works.

@ ot_207: i dont think that we need the full code for this. the code works perfect without any bugs but i dont like to have a cvar for this func.
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 04-02-2009 , 15:03   Re: define/register_cvar
Reply With Quote #5

Quote:
Originally Posted by One View Post
@ ot_207: i dont think that we need the full code for this. the code works perfect without any bugs but i dont like to have a cvar for this func.
Sometimes that can be usefull ...
And advice, use pcvars not cvars
__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.
ot_207 is offline
SchlumPF*
Veteran Member
Join Date: Mar 2007
Old 04-02-2009 , 15:11   Re: define/register_cvar
Reply With Quote #6

defining a float or integer wont change the result, the error has to be in your code somewhere.
__________________
SchlumPF* is offline
Send a message via ICQ to SchlumPF*
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 04-02-2009 , 15:20   Re: define/register_cvar
Reply With Quote #7

Quote:
Originally Posted by SchlumPF* View Post
defining a float or integer wont change the result, the error has to be in your code somewhere.
its my catch mod.i want try to fix the mod. but be sure that in the code about speed, u can never find any errors.btw ill try that what xpaw said & if this not works, ill post the full code here.
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
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:28.


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