Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Copyright (c) 2015-2016 Fighting & Interior Manager
- *
- * This program is free software: you can Ristribute it and/or modify it under the terms of the
- * GNU General Public License as published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
- * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with this program.
- * If not, see <http://www.gnu.org/licenses/>.
- */
- /*AUTHOR ***********************
- @Yaa - SA-MP Scripter
- ********************************/
- #if defined _FIMANAGER_
- #endinput
- #endif
- #define _FIMANAGER_
- new bool:IsFighting[MAX_PLAYERS];
- new bool:IsInterior[MAX_PLAYERS];
- forward onPlayerFinishFight(playerid);
- forward OnPlayerStartFighting(playerid);
- forward OnPlayerEnterInterior(playerid);
- forward IsPlayerFighting(playerid);
- forward IsPlayerInInterior(playerid);
- // Fighting Manager =========================================================================
- public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
- {
- if(IsFighting[playerid] == true) return 1;
- IsFighting[playerid] = true;
- CallLocalFunction("OnPlayerStartFighting", "i", i);
- SetTimerEx("onPlayerFinishFight", 15*1000, false, "i", playerid);
- #if defined VFUNC_OnPlayerWeaponShot
- return VFUNC_OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, fX, fY, fZ);
- #else
- return 1;
- #endif
- }
- #if defined VFUNC_OnPlayerWeaponShot
- forward VFUNC_OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, fX, fY, fZ);
- #endif
- #if defined _ALS_OnPlayerWeaponShot
- #undef OnPlayerWeaponShot
- #else
- #define _ALS_OnPlayerWeaponShot
- #endif
- #define OnPlayerWeaponShot VFUNC_OnPlayerWeaponShot
- public IsPlayerFighting(playerid)
- if(IsFighting[playerid] == true) return 1;
- else return 0;
- public onPlayerFinishFight(playerid)
- {
- IsFighting[playerid] = 0;
- return 1;
- }
- // Interior Manager =========================================================================
- public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
- {
- if(oldinteriorid == 0 && newinteriorid != 0)
- {
- IsInterior[playerid] = true;
- CallLocalFunction("OnPlayerEnterInterior", "i", i);
- return 1;
- }
- else if(oldinteriorid != 0 && newinteriorid == 0)
- {
- IsInterior[playerid] = false;
- return 1;
- }
- #if defined VFUNC_OnPlayerInteriorChange
- return VFUNC_OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
- #else
- return 1;
- #endif
- }
- #if defined VFUNC_OnPlayerInteriorChange
- forward VFUNC_OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
- #endif
- #if defined _ALS_OnPlayerInteriorChange
- #undef OnPlayerInteriorChange
- #else
- #define _ALS_OnPlayerInteriorChange
- #endif
- #define OnPlayerInteriorChange VFUNC_OnPlayerInteriorChange
- public IsPlayerInInterior(playerid)
- if(IsInterior[playerid] == true) return 1;
- else return 0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement