Raised This Month: $ Target: $400
 0% 

[ Solved ] Why it's do not work ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Aooka
Veteran Member
Join Date: Aug 2011
Location: Villeurbanne
Old 07-02-2012 , 16:19   [ Solved ] Why it's do not work ?
Reply With Quote #1

Code:
#include < amxmodx > #include < fun > public plugin_init( ) {     register_plugin( "Special Health Gravity" , "1.2" , "Aooka" );         register_event( "Health" , "EventHealth" , "be" ); } public EventHealth( id ) {     new iHealth = read_data( 1 );         if( iHealth != 0 )     {         set_user_gravity( id , float( iHealth / 100 ) );     }     return 0; }

All is in the title... Thanks
__________________
Pawn ? Useless

Last edited by Aooka; 07-02-2012 at 16:19.
Aooka is offline
<VeCo>
Veteran Member
Join Date: Jul 2009
Location: Bulgaria
Old 07-02-2012 , 16:26   Re: [ Request ] Why it's do not work ?
Reply With Quote #2

PHP Code:
set_user_gravityid iHealth 100.0 ); 
Because, first is executed that expression into the float function, then the native makes it as a float. As an integer, every number below 100 will give 0 (99 / 100 = 0.99 , but as int it is rounded to 0, then you make that 0 to float = 0.0 gravity which the native sets as 1.0).
__________________

Last edited by <VeCo>; 07-02-2012 at 16:29.
<VeCo> is offline
Aooka
Veteran Member
Join Date: Aug 2011
Location: Villeurbanne
Old 07-03-2012 , 03:35   Re: [ Request ] Why it's do not work ?
Reply With Quote #3

Oh thanks a lot Veco. I go test it
__________________
Pawn ? Useless
Aooka 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 15:21.


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