Raised This Month: $ Target: $400
 0% 

Check if(variable)... Doesn't work


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
proffs
Senior Member
Join Date: Jul 2013
Old 03-28-2014 , 13:35   Check if(variable)... Doesn't work
Reply With Quote #1

I need to check if( GAME_DGBALL <= g_iCurrentGame <= GAME_ZMBOMBS )

This is my way to do it, but this part:
PHP Code:
if(iEnt == && GAME_DGBALL <= g_iCurrentGame <= GAME_ZMBOMBS
    { 
Makes it crash the server.

If I only have:

PHP Code:
if( GAME_DGBALL <= g_iCurrentGame <= GAME_ZMBOMBS )
    {
        return 
PLUGIN_CONTINUE;
    } 

It wont work because fuck logic?

PHP Code:
public ball_interact(iBalliEnt
{    
    if( 
GAME_DGBALL <= g_iCurrentGame <= GAME_ZMBOMBS )
    {
        return 
PLUGIN_CONTINUE;
    }    
    
    if(
iEnt == && GAME_DGBALL <= g_iCurrentGame <= GAME_ZMBOMBS
    {
        
entity_set_int(iBallEV_INT_iuser11)
        
set_rendering(iBall);
    }
    else 
    {
        new 
iClassname[32]
        
entity_get_string(iEnt,EV_SZ_classnameiClassnamecharsmax(iClassname))
        
        if(
equali(iClassname,"func_"5)) 
        {
            
entity_set_int(iBallEV_INT_iuser11)
            
set_rendering(iBall)

            new 
Float:start[3], Float:end[3], Float:ground[3]
            
entity_get_vector(iBallEV_VEC_originstart)
            
end start
            end
[2] -= 1024.0
            trace_line
(iEnt,start,end,ground)
            
ground[2] += 7.0
            entity_set_vector
(iBallEV_VEC_originground)
        }
    }
    return 
PLUGIN_CONTINUE


Last edited by proffs; 03-28-2014 at 14:06.
proffs is offline
ironskillz1
AlliedModders Donor
Join Date: Jul 2012
Location: Sweden
Old 03-28-2014 , 14:25   Re: Check if(variable)... Doesn't work
Reply With Quote #2

Code:
public ball_interact(iBall, iEnt)  
{     
    if( GAME_DGBALL <= g_iCurrentGame <= GAME_ZMBOMBS ) 
    { 
        return PLUGIN_CONTINUE; 
    }     
     
    if(iEnt == 0)  
    { 
        entity_set_int(iBall, EV_INT_iuser1, 1) 
        set_rendering(iBall); 
    } 
    else  
    { 
        new iClassname[32] 
        entity_get_string(iEnt,EV_SZ_classname, iClassname, charsmax(iClassname)) 
         
        if(equali(iClassname,"func_", 5))  
        { 
            entity_set_int(iBall, EV_INT_iuser1, 1) 
            set_rendering(iBall) 

            new Float:start[3], Float:end[3], Float:ground[3] 
            entity_get_vector(iBall, EV_VEC_origin, start) 
            end = start 
            end[2] -= 1024.0 
            trace_line(iEnt,start,end,ground) 
            ground[2] += 7.0 
            entity_set_vector(iBall, EV_VEC_origin, ground) 
        } 
    } 
    return PLUGIN_CONTINUE 
}
__________________
I have many private and unique plugins for Jailbreak and Hide'N'Seek. PM me for more info.

Pm me.

Check out my roulette site.
ironskillz1 is offline
Send a message via Skype™ to ironskillz1
proffs
Senior Member
Join Date: Jul 2013
Old 03-28-2014 , 14:34   Re: Check if(variable)... Doesn't work
Reply With Quote #3

Quote:
Originally Posted by ironskillz1 View Post
Code:
public ball_interact(iBall, iEnt)  
{     
    if( GAME_DGBALL <= g_iCurrentGame <= GAME_ZMBOMBS ) 
    { 
        return PLUGIN_CONTINUE; 
    }     
     
    if(iEnt == 0)  
    { 
        entity_set_int(iBall, EV_INT_iuser1, 1) 
        set_rendering(iBall); 
    } 
    else  
    { 
        new iClassname[32] 
        entity_get_string(iEnt,EV_SZ_classname, iClassname, charsmax(iClassname)) 
         
        if(equali(iClassname,"func_", 5))  
        { 
            entity_set_int(iBall, EV_INT_iuser1, 1) 
            set_rendering(iBall) 

            new Float:start[3], Float:end[3], Float:ground[3] 
            entity_get_vector(iBall, EV_VEC_origin, start) 
            end = start 
            end[2] -= 1024.0 
            trace_line(iEnt,start,end,ground) 
            ground[2] += 7.0 
            entity_set_vector(iBall, EV_VEC_origin, ground) 
        } 
    } 
    return PLUGIN_CONTINUE 
}
But then all regular nades will float on floor.
So it wont work at this way..
And the code you posted before, didn't help at all.
proffs is offline
ironskillz1
AlliedModders Donor
Join Date: Jul 2012
Location: Sweden
Old 03-28-2014 , 14:39   Re: Check if(variable)... Doesn't work
Reply With Quote #4

From my private daysmenu

Code:
public ball_interact(ball,ent) 
{
	if( GAME_DGBALL <= g_iCurrentGame <= GAME_ZMBOMBS ) 
	{
		if(ent == 0) {
			entity_set_int(ball,EV_INT_iuser1,1); 
			set_rendering(ball); 
		}
		else {
			new classname[32];
			entity_get_string(ent,EV_SZ_classname,classname,31);
		
			if(equali(classname,"func_",5)) {
				entity_set_int(ball,EV_INT_iuser1,1); 
				set_rendering(ball); 
			
			}
		}
	}
	return PLUGIN_CONTINUE;
}
__________________
I have many private and unique plugins for Jailbreak and Hide'N'Seek. PM me for more info.

Pm me.

Check out my roulette site.

Last edited by ironskillz1; 03-28-2014 at 14:39.
ironskillz1 is offline
Send a message via Skype™ to ironskillz1
proffs
Senior Member
Join Date: Jul 2013
Old 03-28-2014 , 14:51   Re: Check if(variable)... Doesn't work
Reply With Quote #5

Quote:
Originally Posted by ironskillz1 View Post
From my private daysmenu

Code:
public ball_interact(ball,ent) 
{
	if( GAME_DGBALL <= g_iCurrentGame <= GAME_ZMBOMBS ) 
	{
		if(ent == 0) {
			entity_set_int(ball,EV_INT_iuser1,1); 
			set_rendering(ball); 
		}
		else {
			new classname[32];
			entity_get_string(ent,EV_SZ_classname,classname,31);
		
			if(equali(classname,"func_",5)) {
				entity_set_int(ball,EV_INT_iuser1,1); 
				set_rendering(ball); 
			
			}
		}
	}
	return PLUGIN_CONTINUE;
}
Thanks, works now. Let see if it crashes!
proffs is offline
Reply


Thread Tools
Display Modes

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 06:03.


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