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

Changing bool value.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
lolzin123
Member
Join Date: Apr 2009
Old 08-09-2009 , 11:36   Changing bool value.
Reply With Quote #1

How i change te value of the bool...

PHP Code:
if (g_bool[plr])
    {
        
g_bool[plr] = false 
    

the changing is like that or there is another way? THANX
lolzin123 is offline
Old 08-09-2009, 11:46
xPaw
This message has been deleted by xPaw.
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 08-09-2009 , 11:47   Re: Changing bool value.
Reply With Quote #2

Whats the problem?
__________________
xPaw is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-09-2009 , 11:48   Re: Changing bool value.
Reply With Quote #3

PHP Code:
g_bool[plr] = !g_bool[plr
__________________
fysiks is offline
lolzin123
Member
Join Date: Apr 2009
Old 08-09-2009 , 15:36   Re: Changing bool value.
Reply With Quote #4

the question is... the way i use it's correct?
lolzin123 is offline
biscuit628
Senior Member
Join Date: Jun 2007
Location: 香港HongKong
Old 08-09-2009 , 15:44   Re: Changing bool value.
Reply With Quote #5

Quote:
Originally Posted by lolzin123 View Post
the question is... the way i use it's correct?
if (g_bool[plr] == true)
{
//change the bool to false
g_bool[plr] = false
}


it is correct.
__________________
My Plugins

C4man with fun

Sniper Skill bonus
-------------------------
Sorry for my poor English!
biscuit628 is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-09-2009 , 15:51   Re: Changing bool value.
Reply With Quote #6

It's correct, but if you want to reverse the value, do like fysiks.
__________________
Arkshine is offline
lolzin123
Member
Join Date: Apr 2009
Old 08-09-2009 , 18:39   Re: Changing bool value.
Reply With Quote #7

How i make a bool to block and unblock the value of the honey block... like in a menu ... turn on the honey at the player and turn off.

The Code:
PHP Code:
actionHoney(id)
{
    new 
taskid TASK_HONEY id;
    
    
//make player feel like they're stuck in honey by lowering their maxspeed
    
set_user_maxspeed(id50.0);
    
    
//remove any existing 'in honey' task
    
if (task_exists(taskid))
    {
        
remove_task(taskid);
    }
    else
    {
        
//half the players velocity the first time they touch it
        
new Float:vVelocity[3];
        
entity_get_vector(idEV_VEC_velocityvVelocity);
        
vVelocity[0] = vVelocity[0] / 2.0;
        
vVelocity[1] = vVelocity[1] / 2.0;
        
entity_set_vector(idEV_VEC_velocityvVelocity);
    }
    
    
//set task to remove 'in honey' effect very soon (task replaced if player is still in honey before task time reached)
    
set_task(0.1"taskNotInHoney"taskid);

lolzin123 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 08-09-2009 , 18:53   Re: Changing bool value.
Reply With Quote #8

PHP Code:
#include <amxmodx>
#include <engine>
#include <fun>

new const Floatg_fMaxSpeed[] = 
{
    
250.0//no weapon
    
250.0//p228
    
0.0,   //shield
    
260.0//scout
    
250.0//hegrenade
    
240.0//xm1014
    
250.0//c4
    
250.0//mac10
    
240.0//aug
    
250.0//smoke
    
250.0//elite
    
250.0//fiveseven
    
250.0//ump45
    
210.0//sg550
    
240.0//galil
    
240.0//famas
    
250.0//usp
    
250.0//glock
    
210.0//awp
    
250.0//mp5navy
    
220.0//m249
    
230.0//m3
    
230.0//m4a1
    
250.0//tmp
    
210.0//g3sg1
    
250.0//flash
    
250.0//deagle
    
235.0//sg552
    
221.0//ak47
    
250.0//knife
    
245.0  //p90
};

new 
boolg_bHoney33 ];
new 
g_iCurWeapon33 ];

public 
plugin_init() 
{
    
register_plugin"honey" "1.0" "bugsy" );
    
    
register_event"CurWeapon" "fw_CurWeapon" "be" "1=1" );
    
    
register_clcmd"say /honey" "DoHoney" );
    
register_clcmd"say /removehoney" "RemoveHoney" );
}

public 
fw_CurWeaponid )
{
    static 
iWeaponiWeapon read_data);
    
    if ( 
g_bHoneyid ] && ( g_iCurWeaponid ] != iWeapon ) )
    {
        
set_user_maxspeedid 50.0 );
        
        
g_iCurWeaponid ] = iWeapon;
    }
}

public 
DoHoneyid )
{
    static 
Float:vVelocity];
    
    if ( !
g_bHoneyid ] )
    {
        
entity_get_vectorid EV_VEC_velocity vVelocity );
        
vVelocity[0] = vVelocity[0] / 2.0;
        
vVelocity[1] = vVelocity[1] / 2.0;
        
entity_set_vectorid EV_VEC_velocity vVelocity );
        
        
set_user_maxspeedid 50.0 );
        
        
g_bHoneyid ] = true;
    }
}

public 
RemoveHoneyid )
{
    if ( 
g_bHoneyid ] )
    {
        
g_bHoneyid ] = false;
        
        
set_user_maxspeedid g_fMaxSpeedget_user_weaponid ) ] );
    }

__________________

Last edited by Bugsy; 08-09-2009 at 18:58.
Bugsy is offline
lolzin123
Member
Join Date: Apr 2009
Old 08-09-2009 , 19:09   Re: Changing bool value.
Reply With Quote #9

NOO I'm try to make a menu, when you turn on the player can walk on honey block and nothing happens... when turn off the action honey is true...
I'm tryng to do this with bool... like the godmode of bm...
lolzin123 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 16:58.


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