Raised This Month: $ Target: $400
 0% 

Use button


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Vechta
Veteran Member
Join Date: Jun 2010
Old 08-01-2010 , 09:04   Use button
Reply With Quote #1

Can someone correct please all bugs?
And if im pressing E nothing happen on all classes :/

Code:
Code:
public FwdCmdStart(id, uc_handle, seed)
{
	if(!is_user_alive(id))
		return FMRES_IGNORED
		
	new button = get_user_button(id)
	new oldbutton = get_user_oldbutton(id)
		
	if (zp_get_user_zombie(id) && zp_get_user_zombie_class(id) == g_zclass_smoker)
	{
		if ((button & IN_USE) && (oldbutton && IN_USE))
			drag_start(id)
		
		if ((!button & IN_USE) && (oldbutton & IN_USE))
			drag_end(id)
	}
	
	if (zp_get_user_zombie(id) && zp_get_user_zombie_class(id) == g_zclass_charger)
	{
		if ((button & IN_USE) && (oldbutton && IN_USE))
		{
			set_task(0.1, "charger_push", id)
		}
	}
	
	new distance
	get_user_aiming(id, aimed, body, distance);
	
	if (zp_get_user_zombie(id) && zp_get_user_zombie_class(id) == g_zclass_jockey)
	{
		if ((button & IN_USE) && (oldbutton && IN_USE))
		{
			if(distance < 25.0)
			{
				if (is_user_alive(aimed) && zp_get_user_zombie(aimed))
				{
					set_user_health(aimed, get_user_health(aimed) + 500)
				}
			}
		}
	}
}
Vechta is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 08-01-2010 , 09:09   Re: Use button
Reply With Quote #2

When doing a bit-operation, make sure to use the correct operator: && should be &. I highlighted the lines where this correction is needed.
Code:
public FwdCmdStart(id, uc_handle, seed) {     if(!is_user_alive(id))         return FMRES_IGNORED             new button = get_user_button(id)     new oldbutton = get_user_oldbutton(id)             if (zp_get_user_zombie(id) && zp_get_user_zombie_class(id) == g_zclass_smoker)     {         if ((button & IN_USE) && (oldbutton && IN_USE))             drag_start(id)                 if ((!button & IN_USE) && (oldbutton & IN_USE))             drag_end(id)     }         if (zp_get_user_zombie(id) && zp_get_user_zombie_class(id) == g_zclass_charger)     {         if ((button & IN_USE) && (oldbutton && IN_USE))         {             set_task(0.1, "charger_push", id)         }     }         new distance     get_user_aiming(id, aimed, body, distance);         if (zp_get_user_zombie(id) && zp_get_user_zombie_class(id) == g_zclass_jockey)     {         if ((button & IN_USE) && (oldbutton && IN_USE))         {             if(distance < 25.0)             {                 if (is_user_alive(aimed) && zp_get_user_zombie(aimed))                 {                     set_user_health(aimed, get_user_health(aimed) + 500)                 }             }         }     } }
__________________
Bugsy is offline
Vechta
Veteran Member
Join Date: Jun 2010
Old 08-01-2010 , 09:15   Re: Use button
Reply With Quote #3

Thanks, can you also fix the bug with get_user_aiming i dont know anything about it and i can find anything that can help me :S
Vechta is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 08-01-2010 , 09:16   Re: Use button
Reply With Quote #4

What is it supposed to do?
__________________
Bugsy is offline
Vechta
Veteran Member
Join Date: Jun 2010
Old 08-01-2010 , 09:18   Re: Use button
Reply With Quote #5

If aiming at zombie and pressing E that the zombie get 500hp
Vechta is offline
Old 08-01-2010, 09:27
Bugsy
This message has been deleted by Bugsy. Reason: Incorrect
Vechta
Veteran Member
Join Date: Jun 2010
Old 08-01-2010 , 09:50   Re: Use button
Reply With Quote #7

Still dont work
Vechta is offline
Vechta
Veteran Member
Join Date: Jun 2010
Old 08-01-2010 , 12:05   Re: Use button
Reply With Quote #8

So anyone can try to fix ?
Vechta is offline
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
Old 08-01-2010 , 12:33   Re: Use button
Reply With Quote #9

PHP Code:
if (zp_get_user_zombie(id) && zp_get_user_zombie_class(id) == g_zclass_jockey)
{
    if ((
button IN_USE) && (oldbutton && IN_USE))
    {
        static 
aimed body
        
if( get_user_aiming(idaimedbody25) > 0.0 )
        {
            if ( 
is_user_alive(aimed) && zp_get_user_zombie(aimed) )
            {
                
set_user_health(aimedget_user_health(aimed) + 500)
            }
        }
    }

Quote:
Originally Posted by FuncWiki
If the player's aim doesn't hit anything, 0.0 is returned.
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 08-01-2010 , 12:40   Re: Use button
Reply With Quote #10

Oops, my mistake I read the wiki wrong. :-B
__________________
Bugsy 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 00:16.


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