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

How i can Loop my Plugin to no Stop?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
iXaDe
Junior Member
Join Date: Jul 2012
Old 09-10-2012 , 19:09   How i can Loop my Plugin to no Stop?
Reply With Quote #1

Hi,

I have a plugin for modify my FoV, but when i Zoom with Sniper or SG552/AUG ...

Code:
/*
Plugin para modificar o FoV
*/

#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>

public plugin_init() 
{
     register_plugin("Fov", "1.0", "<xFiLe*>")
     RegisterHam(Ham_Spawn, "player", "fw_PlayerSpawn_Post", 1)
	 return PLUGIN_HANDLED;
}

public fw_PlayerSpawn_Post(id)
{
     human_fov(id)
}

public human_fov(id)
{
    if (!is_user_alive(id))
		return
	message_begin(MSG_ONE, get_user_msgid("SetFOV"), _, id)
	write_byte(130)
	message_end() 
}
iXaDe is offline
jimaway
Heeeere's Jimmy!
Join Date: Jan 2009
Location: Estonia
Old 09-10-2012 , 19:13   Re: How i can Loop my Plugin to no Stop?
Reply With Quote #2

register the SetFOV event and when the fov is changed to 90 (or whatever the default fov is) change it back to 130

Last edited by jimaway; 09-10-2012 at 19:14.
jimaway is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 09-10-2012 , 19:23   Re: How i can Loop my Plugin to no Stop?
Reply With Quote #3

Quote:
Originally Posted by iXaDe View Post
I have a plugin for modify my FoV, but when i Zoom with Sniper or SG552/AUG ...
Where is the rest of that sentence?
__________________
fysiks is offline
EpicMonkey
buttmonkey
Join Date: Feb 2012
Old 09-11-2012 , 01:17   Re: How i can Loop my Plugin to no Stop?
Reply With Quote #4

Quote:
Originally Posted by fysiks View Post
Where is the rest of that sentence?
you could say ... he was hungry
EpicMonkey is offline
iXaDe
Junior Member
Join Date: Jul 2012
Old 02-12-2013 , 10:24   Re: How i can Loop my Plugin to no Stop?
Reply With Quote #5

I can't do this, and i dont have a "big" english to explain. But, i need help, i'm noob on programming AMXX :/
iXaDe is offline
P1raten
Senior Member
Join Date: Feb 2010
Old 02-12-2013 , 10:30   Re: Re: How i can Loop my Plugin to no Stop?
Reply With Quote #6

Quote:
Originally Posted by iXaDe View Post
I can't do this
I guess that concludes this thread.
__________________
No salvation. Only madness.
P1raten is offline
Sn!ff3r
Veteran Member
Join Date: Aug 2007
Location: Poland
Old 02-12-2013 , 10:55   Re: How i can Loop my Plugin to no Stop?
Reply With Quote #7

This is really simple.
PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Change FOV"
#define VERSION "1.0"
#define AUTHOR "Sn!ff3r"

#define NEWFOV 130

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_message(get_user_msgid("SetFOV"), "msg_SetFOV")
}

public 
msg_SetFOV() {

    
set_msg_arg_int(1ARG_BYTENEWFOV)    

You must add to this code weapon handling function to get work zoom in weapons.

Or anything like this
PHP Code:
if(get_msg_arg_int(1) == 90)
        
set_msg_arg_int(1ARG_BYTENEWFOV
;)
__________________
Join US - custom Zombie Server - Custom Addons:




Last edited by Sn!ff3r; 02-12-2013 at 10:58.
Sn!ff3r is offline
Send a message via Skype™ to Sn!ff3r
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 09:54.


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