AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How i can Loop my Plugin to no Stop? (https://forums.alliedmods.net/showthread.php?t=195723)

iXaDe 09-10-2012 19:09

How i can Loop my Plugin to no Stop?
 
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()
}


jimaway 09-10-2012 19:13

Re: How i can Loop my Plugin to no Stop?
 
register the SetFOV event and when the fov is changed to 90 (or whatever the default fov is) change it back to 130

fysiks 09-10-2012 19:23

Re: How i can Loop my Plugin to no Stop?
 
Quote:

Originally Posted by iXaDe (Post 1796278)
I have a plugin for modify my FoV, but when i Zoom with Sniper or SG552/AUG ...

Where is the rest of that sentence?

EpicMonkey 09-11-2012 01:17

Re: How i can Loop my Plugin to no Stop?
 
Quote:

Originally Posted by fysiks (Post 1796292)
Where is the rest of that sentence?

you could say ... he was hungry :3

iXaDe 02-12-2013 10:24

Re: How i can Loop my Plugin to no Stop?
 
I can't do this, and i dont have a "big" english to explain. But, i need help, i'm noob on programming AMXX :/

P1raten 02-12-2013 10:30

Re: Re: How i can Loop my Plugin to no Stop?
 
Quote:

Originally Posted by iXaDe (Post 1893007)
I can't do this

I guess that concludes this thread.

Sn!ff3r 02-12-2013 10:55

Re: How i can Loop my Plugin to no Stop?
 
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

;)


All times are GMT -4. The time now is 11:11.

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