10.08.2011, 18:02
Quote:
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);