Raised This Month: $51 Target: $400
 12% 

Solved Tag mismatch - new syntax


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ozrich
AlliedModders Donor
Join Date: Oct 2015
Old 04-22-2019 , 11:40   Tag mismatch - new syntax
Reply With Quote #1

Hi Folks,

I have a function and receive a mismatch for
PHP Code:
g_iTimeCheckHeight[entity] = iRoundHeight
The function is:

PHP Code:
public Action HealthkitGroundCheck(int entityint activatorint callerUseType typefloat value
{
    
float fOrigin[3];
    
GetEntPropVector(entityProp_Send"m_vecOrigin"fOrigin);
    
float iRoundHeight RoundFloat(fOrigin[2]);
    if (
iRoundHeight != g_iTimeCheckHeight[entity]) 
    {
        
g_iTimeCheckHeight[entity] = iRoundHeight;
        
g_fTimeCheck[entity] = GetGameTime();
    }

g_iTimeCheckHeight is a global variable which is
PHP Code:
float g_iTimeCheckHeight[2048] = {0.0, ...}; 
The function that calls the above function is
PHP Code:
public void OnEntityCreated(int entity, const char[] classname)
{
    if (
StrEqual(classname"healthkit"))
    {
        
Handle hDatapack;
        
CreateDataTimer(Healthkit_Timer_TickrateHealthkithDatapackTIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
        
WritePackCell(hDatapackentity);
        
WritePackFloat(hDatapackGetGameTime()+Healthkit_Timer_Timeout);
        
g_fLastHeight[entity] = -9999.0;
        
g_iTimeCheckHeight[entity] = -9999.0;
        
SDKHook(entitySDKHook_VPhysicsUpdateHealthkitGroundCheck);
        
CreateTimer(0.1HealthkitGroundCheckTimerentityTIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
    }

Appreciate your help,
Ozzy
__________________

Last edited by ozrich; 04-25-2019 at 12:54.
ozrich is offline
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 04-22-2019 , 11:49   Re: Tag mismatch - new syntax
Reply With Quote #2

And why did the question in the general area of ​​amxmodx, if the code, so I realize is sourcemod?
__________________


Quote:
Originally Posted by fysiks View Post
Please stop trying to help. You appear to just be posting random stuff. Wait until you actually understand more about AMX Mod X and how the game works.
https://iceeedr.com.br/
iceeedr is offline
Send a message via Skype™ to iceeedr
ozrich
AlliedModders Donor
Join Date: Oct 2015
Old 04-22-2019 , 12:26   Re: Tag mismatch - new syntax
Reply With Quote #3

I'm sorry, wrong forum!

It should have been Sourcemod. New syntax is declared with f
__________________
ozrich is offline
impossible_cc
Senior Member
Join Date: Sep 2018
Location: Ukraine
Old 04-22-2019 , 13:04   Re: Tag mismatch - new syntax
Reply With Quote #4

PHP Code:
float iRoundHeight RoundFloat(fOrigin[2]); 
RoundFloat returns int.
So you should do

PHP Code:
float iRoundHeight fOrigin[2]; 
__________________
impossible_cc is offline
ozrich
AlliedModders Donor
Join Date: Oct 2015
Old 04-22-2019 , 13:06   Re: Tag mismatch - new syntax
Reply With Quote #5

That fixed it - thanks
__________________
ozrich 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:13.


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