Raised This Month: $ Target: $400
 0% 

Solved Help coding Godmode for 5secs


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
loiraolhosazul
Member
Join Date: May 2020
Old 01-08-2021 , 23:14   Re: Help coding Godmode for 5secs
Reply With Quote #7

HTML Code:
#include <amxmodx>
#include <fakemeta>
#include <fun>

new iGodMode[33]

public plugin_init()
{
	register_plugin("PLUGIN", "VERSION", "AUTHOR")

	register_forward(FM_CmdStart, "FwCmdStart")
}

public FwCmdStart(id, uc_handle, randseed)
{
	if(!is_user_connected(id) || !is_user_alive(id))
		return FMRES_IGNORED

	static button; button = get_uc(uc_handle , UC_Buttons)
	static oldbutton; oldbutton = pev(id, pev_oldbuttons)

	if(button & IN_USE && !(oldbutton & IN_USE) && !iGodMode[id])
	{
		iGodMode[id] = true
		set_user_godmode(id, true)

		set_task(5.0, "RemoveGodMode", id)

		client_print(id, print_chat, "GodMode ON!")
	}

	return FMRES_IGNORED
}

public RemoveGodMode(id)
{
	if(!is_user_connected(id))
	{
		if(task_exists(id))
			remove_task(id)
		
		return PLUGIN_HANDLED
	}

	iGodMode[id] = false
	set_user_godmode(id, false)
	client_print(id, print_chat, "GodMode Off!")

	return PLUGIN_HANDLED
}
it's a quick thing guys, it doesn't hurt to help.
loiraolhosazul is offline
 



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 14:14.


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