09.08.2011, 11:40
I would be posting it surely in the snippets place just for you sir!
Done, uses unix timestamp, char arrays + booleans & Hooked; How ever, not tested though should work.
To be used with:
Done, uses unix timestamp, char arrays + booleans & Hooked; How ever, not tested though should work.
Code:
/* * To; asdfgh98 * * Hi! * * * From; The guy that made something more better. */ #include <a_samp> /* ** Player Data ** */ new bool: p_ReloadedCalled[MAX_PLAYERS char], p_Timestamp[MAX_PLAYERS char] ; forward OnPlayerReload(playerid, weapon, ammo); public OnPlayerUpdate(playerid) { if(GetPlayerWeaponState(playerid) == WEAPONSTATE_RELOADING) { if(p_ReloadedCalled{playerid} == false) { p_ReloadedCalled{playerid} = true; p_Timestamp{playerid} = gettime()+((30/2)/2); // CBS finding the total CallRemoteFunction("OnPlayerReload", "ddd", playerid, GetPlayerWeapon(playerid), GetPlayerAmmo(playerid)); } } if(p_Timestamp{playerid} == gettime() && p_ReloadedCalled{playerid} == true) { p_Timestamp{playerid} = 0, p_ReloadedCalled{playerid} = false; } return CallRemoteFunction("lorenc_OnPlayerUpdate", "d", playerid); } #if defined _ALS_OnPlayerUpdate #undef OnPlayerUpdate #else #define _ALS_OnPlayerUpdate #endif #define OnPlayerUpdate lorenc_OnPlayerUpdate forward OnPlayerUpdate(playerid);
Code:
public OnPlayerReload(playerid, weapon, ammo) { return 1; }