Advertisement
LZLo

OnPlayerReloading R4

Aug 10th, 2011
806
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.39 KB | None | 0 0
  1. ///---OnPlayerReloading(playerid, weaponid, ammo);---///
  2. //Release 4
  3. /*by*/
  4.  
  5.  
  6. //     //////  //
  7. //       ///   //     /////
  8. //      ///    //     // //
  9. ////// //////  ////// /////
  10.  
  11. /*-------------------------------------------------------*/
  12.  
  13. #include <a_samp>
  14. #tryinclude <foreach>
  15.  
  16. #if defined OPRL
  17.         #endinput
  18. #endif
  19. #define OPRL
  20.  
  21. forward OnPlayerReloading(playerid, weaponid, ammo);
  22. forward EndReloading(playerid);
  23. new P_InReloading[MAX_PLAYERS];
  24.  
  25. public OnPlayerUpdate(playerid)
  26. {
  27.     new iWeaponid = GetPlayerWeapon(playerid);
  28.     if(GetPlayerWeaponState(playerid) == 3 && iWeaponid != 25)//WEAPONSTATE_RELOADING
  29.     {
  30.         new iAmmo = GetPlayerAmmo(playerid);
  31.         if(P_InReloading[playerid] == 0) {
  32.         CallLocalFunction("OnPlayerReloading", "idd", playerid, iWeaponid, iAmmo);
  33.         SetTimerEx("EndReloading", 2100, 0, "d", playerid);
  34.         }
  35.         P_InReloading[playerid] = 1;
  36.     }
  37.     if(funcidx("OnPlayerUpdate")) return CallRemoteFunction("OnPlayerUpdate", "i", playerid);
  38.     return 1;
  39. }
  40.  
  41. public EndReloading(playerid)
  42. {
  43.     P_InReloading[playerid] = 0;
  44.     return 1;
  45. }
  46.  
  47. #if defined _ALS_OnPlayerUpdate
  48.     #undef OnPlayerUpdate
  49. #else
  50.     #define _ALS_OnPlayerUpdate
  51. #endif
  52. #define OnPlayerUpdate LZLo_OnPlayerUpdate
  53. forward LZLo_OnPlayerUpdate(playerid);
  54.  
  55. ///---OnPlayerReloading(playerid, weaponid, ammo);---///
  56. //Release 4
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement