AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Speed plugin works only after weaponswitch (https://forums.alliedmods.net/showthread.php?t=53623)

regalis 04-07-2007 18:15

Speed plugin works only after weaponswitch
 
Fixed bugs...

In plugin_init i have registered this event
Code:

register_event("CurWeapon","Change_Wpn","be")


Then in the funktion i forgotten to check if the changed weapon is active...
Code:

// Called on player switches his weapon
public Change_Wpn(id)
{
    if (!get_pcvar_num(g_speed_enabled)) return PLUGIN_HANDLED
       
    new WeaponNum = read_data(2)
    new WeaponActive = read_data(1)

    if (WeaponNum != WeaponUsed[id] && WeaponActive)
    {
        param[0] = id
        calculate_speed(WeaponNum)       
        give_speed()
        WeaponUsed[id] = WeaponNum
    }
    return PLUGIN_HANDLED
}


regalis 04-09-2007 09:56

Re: Speed plugin works only after weaponswitch
 
Fixed all bugs...


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

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