AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   This is realy weird (?) (https://forums.alliedmods.net/showthread.php?t=121707)

joropito 03-18-2010 22:32

This is realy weird (?)
 
This compiles fine
PHP Code:

        if(get_distance_f(originlast) < 32.0)
        {
                return 
PLUGIN_CONTINUE
        


This give me error error 029: invalid expression, assumed zero
PHP Code:

        if(get_distance_f(originlast) < 32.0)
                return 
PLUGIN_CONTINUE 


Exolent[jNr] 03-18-2010 22:45

Re: This is realy weird (?)
 
Hmm. Show the whole containing function.

joropito 03-18-2010 22:50

Re: This is realy weird (?)
 
PHP Code:

public client_PreThink(id)
{
        if(
id != g_Simon || !get_pcvar_num(gp_SimonSteps) || !is_user_alive(id) ||
                !(
entity_get_int(idEV_INT_flags) & FL_ONGROUND) || entity_get_int(idEV_ENT_groundentity))
                return 
PLUGIN_CONTINUE

        
static Float:origin[3]
        static 
Float:last[3]

        
entity_get_vector(idEV_VEC_originorigin)
        if(
get_distance_f(originlast) < 32.0)
        {
                return 
PLUGIN_CONTINUE
        
}

// and more code



wrecked_ 03-18-2010 23:36

Re: This is realy weird (?)
 
I've actually had this happen a few times. Never really gave it much thought. I saw that it happened in large functions more often than those with hardly anything in it.

Sylwester 03-18-2010 23:41

Re: This is realy weird (?)
 
Both compile fine...
Next time when you get strange error, post whole code instead of short fragment.

joropito 03-19-2010 07:23

Re: This is realy weird (?)
 
Quote:

Originally Posted by Sylwester (Post 1122006)
Both compile fine...
Next time when you get strange error, post whole code instead of short fragment.

I've done a lot of tests.

The sentence in my first post compiles fine in a single function plugin.
I don't matter if I must use brackets or not in that part of code.

I'm just posting the error in case someone had similar problems.

Thanks


All times are GMT -4. The time now is 08:37.

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