Raised This Month: $32 Target: $400
 8% 

must be lvalue (non-constant)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
XSlayer
Member
Join Date: Dec 2021
Old 07-17-2022 , 22:50   must be lvalue (non-constant)
Reply With Quote #1

PHP Code:
stock Encode16Fixed_4dot12(Float:x)
{
   
*= float(<< 12);
   new 
val floatround(xfloatround_floor);
   return 
val<: (val>0xFFFF 0xFFFF val);

Code:
must be lvalue (non-constant)
does anyone known why thow me that error?,
PHP Code:
*= float(<< 12); 
XSlayer is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 07-17-2022 , 23:30   Re: must be lvalue (non-constant)
Reply With Quote #2

Compiles fine for me. Do you maybe have x defined globally, as a constant?

Simple fix:
PHP Code:
stock Encode16Fixed_4dot12(Float:fValue)
{
    
fValue *= float(<< 12);
    new 
val floatround(fValuefloatround_floor);
    return 
val<: (val>0xFFFF 0xFFFF val);

__________________
Bugsy is offline
XSlayer
Member
Join Date: Dec 2021
Old 07-18-2022 , 01:13   Re: must be lvalue (non-constant)
Reply With Quote #3

Quote:
Originally Posted by Bugsy View Post
Compiles fine for me. Do you maybe have x defined globally, as a constant?

Simple fix:
PHP Code:
stock Encode16Fixed_4dot12(Float:fValue)
{
    
fValue *= float(<< 12);
    new 
val floatround(fValuefloatround_floor);
    return 
val<: (val>0xFFFF 0xFFFF val);

oo that was, yes i had a X gloabal constant XD my bad, thanks by the way
XSlayer is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 07-18-2022 , 03:37   Re: must be lvalue (non-constant)
Reply With Quote #4

Quote:
Originally Posted by XSlayer View Post
oo that was, yes i had a X gloabal constant XD my bad, thanks by the way
Always make the global variables names declaration very unique, and start it with the tag g_ as for global.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
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 04:44.


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