[Include] OnPlayerReloading(playerid, weaponid, ammo) R1 - by LZLo
#24

Quote:
Originally Posted by asdfgh98
View Post
Nice one but i read that there are some problems (Read Riderґs post (in the snippets thread))
Code:
/*
 *  To; Lorenc_
 *
 *      Sup.
*/

#include                        <a_samp>

/* ** Player Data ** */
new
    cur_Weapon_State[MAX_PLAYERS]
;

forward OnPlayerReload(playerid, weapon, ammo);
forward OnPlayerWeaponStateChange(playerid, newstate, oldstate);

public OnPlayerConnect(playerid)
{
    cur_Weapon_State[playerid] = WEAPONSTATE_UNKNOWN;
	return 1;
}

public OnPlayerUpdate(playerid)
{
	new iCurWeaponState = GetPlayerWeaponState(playerid);
    if(iCurWeaponState != cur_Weapon_State[playerid])
    {
        CallLocalFunction("OnPlayerWeaponStateChange", "ddd", playerid, iCurWeaponState, cur_Weapon_State[playerid]);
        cur_Weapon_State[playerid] = iCurWeaponState;
    }
    return CallRemoteFunction("Kar_OnPlayerUpdate", "d", playerid);
}

public OnPlayerWeaponStateChange(playerid, newstate, oldstate)
{
	if(newstate == WEAPONSTATE_RELOADING)
	{
	    CallRemoteFunction("OnPlayerReload", "ddd", playerid, GetPlayerWeapon(playerid), GetPlayerAmmo(playerid));
	}
	return 1;
}

#if defined _ALS_OnPlayerUpdate
    #undef OnPlayerUpdate
#else
    #define _ALS_OnPlayerUpdate
#endif
#define OnPlayerUpdate Kar_OnPlayerUpdate
forward OnPlayerUpdate(playerid);
Reply


Messages In This Thread
OnPlayerReloading(playerid, weaponid, ammo) R4 - by LZLo - by LZLo - 08.08.2011, 11:21
Re: OnPlayerReloading(playerid, weaponid, ammo) R1 - by LZLo - by FireCat - 08.08.2011, 11:23
Re: OnPlayerReloading(playerid, weaponid, ammo) R1 - by LZLo - by LZLo - 08.08.2011, 11:26
Re: OnPlayerReloading(playerid, weaponid, ammo) R1 - by LZLo - by Markx - 08.08.2011, 11:31
Re: OnPlayerReloading(playerid, weaponid, ammo) R1 - by LZLo - by Lorenc_ - 08.08.2011, 11:34
Re: OnPlayerReloading(playerid, weaponid, ammo) R1 - by LZLo - by LZLo - 08.08.2011, 11:38
Re: OnPlayerReloading(playerid, weaponid, ammo) R1 - by LZLo - by leingod - 08.08.2011, 12:31
Re: OnPlayerReloading(playerid, weaponid, ammo) R1 - by LZLo - by freshOrange - 08.08.2011, 12:34
Re: OnPlayerReloading(playerid, weaponid, ammo) R1 - by LZLo - by CaHbKo - 08.08.2011, 12:42
Re: OnPlayerReloading(playerid, weaponid, ammo) R1 - by LZLo - by TheArcher - 08.08.2011, 12:43
Re: OnPlayerReloading(playerid, weaponid, ammo) R1 - by LZLo - by LZLo - 08.08.2011, 13:56
Re: OnPlayerReloading(playerid, weaponid, ammo) R1 - by LZLo - by Kaperstone - 08.08.2011, 15:25
Re: OnPlayerReloading(playerid, weaponid, ammo) R1 - by LZLo - by LZLo - 08.08.2011, 17:10
Re: OnPlayerReloading(playerid, weaponid, ammo) R1 - by LZLo - by rbN. - 08.08.2011, 17:11
Re: OnPlayerReloading(playerid, weaponid, ammo) R1 - by LZLo - by Basicz - 09.08.2011, 00:01
Re : OnPlayerReloading(playerid, weaponid, ammo) R1 - by LZLo - by Soumi - 09.08.2011, 02:05
Re: OnPlayerReloading(playerid, weaponid, ammo) R1 - by LZLo - by Lorenc_ - 09.08.2011, 07:50
AW: OnPlayerReloading(playerid, weaponid, ammo) R1 - by LZLo - by asdfgh98 - 09.08.2011, 08:37
Re: AW: OnPlayerReloading(playerid, weaponid, ammo) R1 - by LZLo - by Lorenc_ - 09.08.2011, 11:40
Re: OnPlayerReloading(playerid, weaponid, ammo) R1 - by LZLo - by LZLo - 09.08.2011, 12:26
AW: OnPlayerReloading(playerid, weaponid, ammo) R1 - by LZLo - by asdfgh98 - 10.08.2011, 10:54
Re: OnPlayerReloading(playerid, weaponid, ammo) R1 - by LZLo - by WillyP - 10.08.2011, 16:50
Re: OnPlayerReloading(playerid, weaponid, ammo) R1 - by LZLo - by DRIFT_HUNTER - 10.08.2011, 16:53
Re: AW: OnPlayerReloading(playerid, weaponid, ammo) R1 - by LZLo - by Kar - 10.08.2011, 18:02
Re: OnPlayerReloading(playerid, weaponid, ammo) R1 - by LZLo - by LZLo - 10.08.2011, 19:07
Re: OnPlayerReloading(playerid, weaponid, ammo) R1 - by LZLo - by Lorenc_ - 11.08.2011, 07:57
Re: OnPlayerReloading(playerid, weaponid, ammo) R1 - by LZLo - by LZLo - 11.08.2011, 10:30
Re: OnPlayerReloading(playerid, weaponid, ammo) R1 - by LZLo - by oFLu - 14.08.2011, 21:02
Re: OnPlayerReloading(playerid, weaponid, ammo) R1 - by LZLo - by Lorenc_ - 14.08.2011, 21:40
Re: OnPlayerReloading(playerid, weaponid, ammo) R1 - by LZLo - by Kalroz - 28.07.2012, 04:38
Re: OnPlayerReloading(playerid, weaponid, ammo) R1 - by LZLo - by Plovix - 13.11.2012, 09:24

Forum Jump:


Users browsing this thread: 8 Guest(s)