Raised This Month: $ Target: $400
 0% 

Question about Speed


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 05-29-2009 , 07:41   Re: Question about Speed
Reply With Quote #1

Try including this in your code:
Code:
public plugin_init()         set_cvar_num("sv_maxspeed", "370");
__________________
hleV is offline
Mr.Noobie
BANNED
Join Date: Apr 2009
Old 05-29-2009 , 11:25   Re: Question about Speed
Reply With Quote #2

Code:
register_event("CurWeapon", "CurWeaponEvent", "be", "1=1")
Code:
public CurWeaponEvent(ClientID)
{
        set_pev(ClientID, pev_maxspeed, 500.0)
}
Code:
set_cvar_num("sv_maxspeed", "500.0")
Error compile:

Code:
argument type mismatch <argument 2>
Mr.Noobie is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-29-2009 , 11:40   Re: Question about Speed
Reply With Quote #3

Try to understand what the error is telling you:

set_cvar_num("sv_maxspeed", "500.0" )

Error compile:

Code:
argument type mismatch <argument 2>
It is saying argument 2 is a type mismatch because you are passing a string as a parameter when the function is expecting an integer.

Proper usage:

PHP Code:
set_cvar_string"sv_maxspeed" "500.0" );
set_cvar_float"sv_maxspeed" 500.0 );
set_cvar_num"sv_maxspeed" 500 ); 
If you will be setting\retrieving this cvar more than once in your plugin then you should use a cvar pointer.

PHP Code:
new g_pMaxSpeed;

g_pMaxSpeed get_cvar_pointer"sv_maxspeed" );

set_pcvar_stringg_pMaxSpeed "500.0" );
set_pcvar_floatg_pMaxSpeed 500.0 );
set_pcvar_numg_pMaxSpeed 500 ); 
To retrieve this value use the appropriate get_pcvar_XX functions.
__________________

Last edited by Bugsy; 05-29-2009 at 11:52.
Bugsy is offline
Mr.Noobie
BANNED
Join Date: Apr 2009
Old 05-30-2009 , 01:40   Re: Question about Speed
Reply With Quote #4

Quote:
Originally Posted by Bugsy View Post
Try to understand what the error is telling you:

set_cvar_num("sv_maxspeed", "500.0" )

Error compile:

Code:
argument type mismatch <argument 2>
It is saying argument 2 is a type mismatch because you are passing a string as a parameter when the function is expecting an integer.

Proper usage:

PHP Code:
set_cvar_string"sv_maxspeed" "500.0" );
set_cvar_float"sv_maxspeed" 500.0 );
set_cvar_num"sv_maxspeed" 500 ); 
If you will be setting\retrieving this cvar more than once in your plugin then you should use a cvar pointer.

PHP Code:
new g_pMaxSpeed;
 
g_pMaxSpeed get_cvar_pointer"sv_maxspeed" );
 
set_pcvar_stringg_pMaxSpeed "500.0" );
set_pcvar_floatg_pMaxSpeed 500.0 );
set_pcvar_numg_pMaxSpeed 500 ); 
To retrieve this value use the appropriate get_pcvar_XX functions.

I use

Code:
set_pcvar_float( g_pMaxSpeed , 500.0 );
it compile work.

but the speed is still default.
Mr.Noobie is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 05-29-2009 , 11:36   Re: Question about Speed
Reply With Quote #5

try set_cvar_float
__________________
xPaw is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-30-2009 , 10:38   Re: Question about Speed
Reply With Quote #6

Try

set_pcvar_string( g_pMaxSpeed , "500.0" );
__________________
Bugsy is offline
Mr.Noobie
BANNED
Join Date: Apr 2009
Old 05-31-2009 , 09:41   Re: Question about Speed
Reply With Quote #7

darn.. I have exam going on this week so i have no time to do add speed for me ?
Attached Files
File Type: sma Get Plugin or Get Source (zp_extra_humanpack.sma - 381 views - 3.3 KB)
Mr.Noobie 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 01:31.


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