Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //----------------------------------------------------------------------------------------------------------------.
- // //
- // Created by Ricky Phelps (SuperViper) //
- // //
- //------------------------------------------------------------------------------------------------------------//
- //-----------------------------------------------------------------------------------------------------------//
- // //
- // Credits //
- // - Scripting: Ricky Phelps //
- // - Beta Testing: Chriham3/Alex Shock //
- // //
- //-----------------------------------------------------------------------------------------------------//
- //----------------------------------------------------------------------------------------------------//
- // ============================================ SETTINGS =========================================== //
- /* Unfair play list (comment the line of anything you don't want to be detected) */
- #define FP_HIGH_PING (1)
- #define FP_WEAPON_HACK (2)
- #define FP_VEHICLE_SPEED_HACK (3)
- #define FP_JETPACK_HACK (4)
- #define FP_DRIVER_DRIVEBY (5) // Commenting this will ENABLE driver driveby
- #define FP_DRIVEBY_WEAPONS_RESTRICT (6)
- #define FP_SWEARING (7)
- #define FP_FLY_HACK (8)
- #define FP_CHAT_SPAM (9)
- #define FP_AFK (10)
- #define FP_TABBING (11)
- #define FP_NINJA_JACK (12)
- #define FP_CAR_RAM (13)
- #define FP_HELIBLADE (14)
- #define FP_VEHICLE_MOD_HACK (15)
- #define FP_SERVER_AD (16)
- #define FP_FAKE_KILL (17)
- #define FP_TELEPORT_HACK (18)
- /* This is the interval of the timer which checks for fair play */
- #define FP_TIMER_INTERVAL (1250)
- /* The maximum ping allowed on the server (will be ignored if high ping detection is disabled) */
- #define FP_MAX_PING (500)
- /* The weapons which are allowed for drivebys (separate with space - will be ignored if driveby weapons restriction is disabled) */
- #define FP_DRIVEBY_WEAPONS "28 29 32"
- /* The IP address of your server (will be ignored if server advertisement detection is disabled) */
- #define FP_SERVER_IP "127.0.0.1"
- /* The domain of your server (will be ignored if server advertisement detection is disabled) */
- #define FP_SERVER_DOMAIN "samp.servername.com"
- /* Curse words (will be ignored if swearing detection is disabled) */
- new FP_CurseWords[][] =
- {
- "ass", "bitch", "cunt", "fuck", "nigga", "nigger", "shit", "whore"
- };
- // ================================================================================================= //
- // =============================== DO NOT TOUCH ANYTHING BELOW THIS =============================== //
- // =============================================================================================== //
- #define FAIRPLAY_INCLUDED
- forward public FP_Detection(playerid);
- forward public OnPlayerUnfairPlay(playerid, playType);
- forward public FP_ReduceChatCounter(playerid);
- forward public FP_VehicleJackCheck(playerid);
- forward public FP_OnPlayerConnect(playerid);
- forward public FP_OnPlayerDisconnect(playerid, reason);
- forward public FP_OnPlayerKeyStateChange(playerid, newkeys, oldkeys);
- forward public FP_OnPlayerDeath(playerid, killerid, reason);
- forward public FP_OnPlayerSpawn(playerid);
- forward public FP_OnPlayerStateChange(playerid, newstate, oldstate);
- forward public FP_OnPlayerText(playerid, text[]);
- forward public FP_OnPlayerUpdate(playerid);
- forward public FP_OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid);
- forward public FP_OnVehicleMod(playerid, vehicleid, componentid);
- forward public FP_OnPlayerEnterVehicle(playerid, vehicleid, ispassenger);
- new FP_PlayerDetectionTimer[MAX_PLAYERS];
- new FP_PlayerWeapons[MAX_PLAYERS][13];
- new FP_WeaponSlots[47] =
- {
- 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 10, 10,
- 10, 10, 10, 10, 8, 8, 8, -1, -1, -1,
- 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, 4, 6,
- 6, 7, 7, 7, 7, 8, 12, 9, 9, 9, 11,
- 11, 11
- };
- new bool: FP_Immune[MAX_PLAYERS];
- new FP_PingWarnings[MAX_PLAYERS];
- new bool: FP_PlayerJetpack[MAX_PLAYERS];
- new FP_ChatCounter[MAX_PLAYERS];
- new FP_LastUpdate[MAX_PLAYERS], Float: FP_LastPosition[MAX_PLAYERS][3];
- new FP_TabbedUpdates[MAX_PLAYERS];
- new FP_VehicleJacker[MAX_PLAYERS], FP_VehicleJackTimer[MAX_PLAYERS];
- new FP_LastPositionSet[MAX_PLAYERS];
- stock SetPlayerFairPlayImmune(playerid, bool: immune)
- {
- return FP_Immune[playerid] = immune;
- }
- FP_GetVehicleSpeed(vehicleID)
- {
- new Float: vehiclesVelocity[3];
- GetVehicleVelocity(vehicleID, vehiclesVelocity[0], vehiclesVelocity[1], vehiclesVelocity[2]);
- return floatround(floatsqroot((vehiclesVelocity[0] * vehiclesVelocity[1] + vehiclesVelocity[2] * vehiclesVelocity[2])) * 100 * 1.6);
- }
- FP_GetHighestWaterLevel(playerid)
- {
- if(IsPlayerInRangeOfPoint(playerid, 50.0, 1962.15, -1198.71, 17.45)) return 19;
- if(IsPlayerInRangeOfPoint(playerid, 100.0, -1127.58, 2764.43, 40.00)) return 43;
- if(IsPlayerInRangeOfPoint(playerid, 100.0, -988.19, 2486.89, 40.00)) return 43;
- if(IsPlayerInRangeOfPoint(playerid, 100.0, -924.33, 2306.59, 40.00)) return 43;
- if(IsPlayerInRangeOfPoint(playerid, 100.0, -1104.15, 2175.83, 40.00)) return 43;
- if(IsPlayerInRangeOfPoint(playerid, 100.0, -1307.06, 2119.33, 40.00)) return 43;
- if(IsPlayerInRangeOfPoint(playerid, 100.0, -831.85, 2122.23, 40.00)) return 43;
- if(IsPlayerInRangeOfPoint(playerid, 100.0, -595.76, 2138.34, 40.00)) return 43;
- if(IsPlayerInRangeOfPoint(playerid, 100.0, -569.24, 2274.40, 40.00)) return 43;
- if(IsPlayerInRangeOfPoint(playerid, 12.0, 1095.800, -674.950, 111.908)) return 113;
- if(IsPlayerInRangeOfPoint(playerid, 12.0, 224.500, -1185.725, 73.908)) return 76;
- if(IsPlayerInRangeOfPoint(playerid, 12.0, 193.700, -1230.608, 76.603)) return 79;
- if(IsPlayerInRangeOfPoint(playerid, 12.0, 1277.500, -805.200, 86.581)) return 88;
- if(IsPlayerInRangeOfPoint(playerid, 12.0, 2582.0, 2387.0, 16.0)) return 18;
- return 10;
- }
- public FP_Detection(playerid)
- {
- if(!FP_Immune[playerid])
- {
- new Float: playersPosition[3], playersState = GetPlayerState(playerid);
- GetPlayerPos(playerid, playersPosition[0], playersPosition[1], playersPosition[2]);
- #if defined FP_TELEPORT_HACK
- if(playersState == PLAYER_STATE_ONFOOT || playersState == PLAYER_STATE_DRIVER || playersState == PLAYER_STATE_PASSENGER || playersState == PLAYER_STATE_SPAWNED)
- {
- if(tickcount() - FP_LastPositionSet[playerid] > FP_TIMER_INTERVAL * 5)
- {
- if(FP_LastPosition[playerid][2])
- {
- if(!IsPlayerInAnyVehicle(playerid) && !GetPlayerInterior(playerid))
- {
- if(!IsPlayerInRangeOfPoint(playerid, 100, FP_LastPosition[playerid][0], FP_LastPosition[playerid][1], FP_LastPosition[playerid][2]))
- {
- CallLocalFunction("OnPlayerUnfairPlay", "dd", playerid, FP_TELEPORT_HACK);
- }
- }
- }
- }
- }
- #endif
- if(playersPosition[0] != FP_LastPosition[playerid][0] || playersPosition[1] != FP_LastPosition[playerid][1] || playersPosition[2] != FP_LastPosition[playerid][2])
- {
- FP_LastPosition[playerid][0] = playersPosition[0], FP_LastPosition[playerid][1] = playersPosition[1], FP_LastPosition[playerid][2] = playersPosition[2];
- FP_LastUpdate[playerid] = tickcount();
- }
- FP_TabbedUpdates[playerid]++;
- #if defined FP_HIGH_PING
- if(GetPlayerPing(playerid) >= FP_MAX_PING)
- {
- FP_PingWarnings[playerid]++;
- if(FP_PingWarnings[playerid] >= 3)
- {
- FP_PingWarnings[playerid] = 0;
- CallLocalFunction("OnPlayerUnfairPlay", "dd", playerid, FP_HIGH_PING);
- }
- }
- #endif
- #if defined FP_VEHICLE_SPEED_HACK
- new playersVehicle = GetPlayerVehicleID(playerid);
- if(playersVehicle)
- {
- new playersSpeed = FP_GetVehicleSpeed(playersVehicle), vehicleModel = GetVehicleModel(playersVehicle);
- if((playersSpeed >= 550 && vehicleModel != 520) || (playersSpeed >= 200 && vehicleModel != 448 && vehicleModel != 461 && vehicleModel != 462 && vehicleModel != 463 && vehicleModel != 468 && vehicleModel != 521 && vehicleModel != 522 && vehicleModel != 523 && vehicleModel != 581 && vehicleModel != 586))
- {
- CallLocalFunction("OnPlayerUnfairPlay", "dd", playerid, FP_VEHICLE_SPEED_HACK);
- }
- }
- #endif
- #if defined FP_JETPACK_HACK
- if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_USEJETPACK)
- {
- if(!FP_PlayerJetpack[playerid])
- {
- CallLocalFunction("OnPlayerUnfairPlay", "dd", playerid, FP_JETPACK_HACK);
- }
- }
- else
- {
- FP_PlayerJetpack[playerid] = false;
- }
- #endif
- #if defined FP_FLY_HACK
- new animationIndex = GetPlayerAnimationIndex(playerid);
- if(animationIndex >= 1538 && animationIndex <= 1544 && animationIndex != 1542 && !GetPlayerInterior(playerid))
- {
- if(playersPosition[2] >= FP_GetHighestWaterLevel(playerid))
- {
- CallLocalFunction("OnPlayerUnfairPlay", "dd", playerid, FP_FLY_HACK);
- }
- }
- #endif
- #if defined FP_AFK
- if(tickcount() - FP_LastUpdate[playerid] >= 300000)
- {
- CallLocalFunction("OnPlayerUnfairPlay", "dd", playerid, FP_AFK);
- }
- #endif
- #if defined FP_TABBING
- if(FP_TabbedUpdates[playerid] >= 3)
- {
- if(playersState == PLAYER_STATE_ONFOOT || playersState == PLAYER_STATE_DRIVER || playersState == PLAYER_STATE_PASSENGER || playersState == PLAYER_STATE_SPAWNED)
- {
- CallLocalFunction("OnPlayerUnfairPlay", "dd", playerid, FP_TABBING);
- }
- }
- #endif
- }
- return 1;
- }
- public FP_ReduceChatCounter(playerid)
- {
- FP_ChatCounter[playerid]--;
- return 1;
- }
- public FP_VehicleJackCheck(playerid)
- {
- FP_VehicleJacker[playerid] = INVALID_PLAYER_ID;
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- for(new weaponIndex; weaponIndex < 13; weaponIndex++)
- {
- FP_PlayerWeapons[playerid][weaponIndex] = 0;
- }
- FP_PingWarnings[playerid] = 0;
- FP_PlayerJetpack[playerid] = false;
- FP_ChatCounter[playerid] = 0;
- FP_LastUpdate[playerid] = tickcount();
- FP_TabbedUpdates[playerid] = 0;
- FP_VehicleJacker[playerid] = INVALID_PLAYER_ID;
- FP_VehicleJackTimer[playerid] = -1;
- FP_LastPositionSet[playerid] = tickcount();
- FP_PlayerDetectionTimer[playerid] = SetTimerEx("FP_Detection", FP_TIMER_INTERVAL, true, "d", playerid);
- return (funcidx("FP_OnPlayerConnect") == -1) ? 1 : CallLocalFunction("FP_OnPlayerConnect", "d", playerid);
- }
- #if defined _ALS_OnPlayerConnect
- #undef OnPlayerConnect
- #else
- #define _ALS_OnPlayerConnect
- #endif
- #define OnPlayerConnect FP_OnPlayerConnect
- public OnPlayerDisconnect(playerid, reason)
- {
- KillTimer(FP_PlayerDetectionTimer[playerid]);
- if(FP_VehicleJackTimer[playerid] != -1)
- {
- KillTimer(FP_VehicleJackTimer[playerid]);
- }
- return (funcidx("FP_OnPlayerDisconnect") == -1) ? 1 : CallLocalFunction("FP_OnPlayerDisconnect", "dd", playerid, reason);
- }
- #if defined _ALS_OnPlayerDisconnect
- #undef OnPlayerDisconnect
- #else
- #define _ALS_OnPlayerDisconnect
- #endif
- #define OnPlayerDisconnect FP_OnPlayerDisconnect
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- if(!FP_Immune[playerid])
- {
- #if defined FP_WEAPON_HACK
- if(newkeys & KEY_FIRE && !IsPlayerInAnyVehicle(playerid))
- {
- new playersWeapon = GetPlayerWeapon(playerid);
- if(playersWeapon && playersWeapon != 40 && playersWeapon != 46)
- {
- if(FP_PlayerWeapons[playerid][FP_WeaponSlots[playersWeapon]] != playersWeapon)
- {
- CallLocalFunction("OnPlayerUnfairPlay", "dd", playerid, FP_WEAPON_HACK);
- }
- }
- }
- #endif
- }
- return (funcidx("FP_OnPlayerKeyStateChange") == -1) ? 1 : CallLocalFunction("FP_OnPlayerKeyStateChange", "ddd", playerid, newkeys, oldkeys);
- }
- #if defined _ALS_OnPlayerKeyStateChange
- #undef OnPlayerKeyStateChange
- #else
- #define _ALS_OnPlayerKeyStateChange
- #endif
- #define OnPlayerKeyStateChange FP_OnPlayerKeyStateChange
- public OnPlayerDeath(playerid, killerid, reason)
- {
- FP_PlayerJetpack[playerid] = false;
- if(!FP_Immune[playerid])
- {
- #if defined FP_NINJA_JACK
- if(FP_VehicleJacker[playerid] != INVALID_PLAYER_ID)
- {
- CallLocalFunction("OnPlayerUnfairPlay", "dd", FP_VehicleJacker[playerid], FP_NINJA_JACK);
- }
- #endif
- #if defined FP_FAKE_KILL
- if(killerid != INVALID_PLAYER_ID)
- {
- new Float: playersHealth;
- GetPlayerHealth(playerid, playersHealth);
- if(playersHealth)
- {
- CallLocalFunction("OnPlayerUnfairPlay", "dd", playerid, FP_FAKE_KILL);
- }
- }
- #endif
- }
- FP_LastPositionSet[playerid] = tickcount();
- return (funcidx("FP_OnPlayerDeath") == -1) ? 1 : CallLocalFunction("FP_OnPlayerDeath", "ddd", playerid, killerid, reason);
- }
- #if defined _ALS_OnPlayerDeath
- #undef OnPlayerDeath
- #else
- #define _ALS_OnPlayerDeath
- #endif
- #define OnPlayerDeath FP_OnPlayerDeath
- public OnPlayerSpawn(playerid)
- {
- FP_PlayerJetpack[playerid] = false;
- FP_LastPositionSet[playerid] = tickcount();
- return (funcidx("FP_OnPlayerSpawn") == -1) ? 1 : CallLocalFunction("FP_OnPlayerSpawn", "d", playerid);
- }
- #if defined _ALS_OnPlayerSpawn
- #undef OnPlayerSpawn
- #else
- #define _ALS_OnPlayerSpawn
- #endif
- #define OnPlayerSpawn FP_OnPlayerSpawn
- public OnPlayerStateChange(playerid, newstate, oldstate)
- {
- if(!FP_Immune[playerid])
- {
- #if defined FP_DRIVER_DRIVEBY
- if(newstate == PLAYER_STATE_DRIVER)
- {
- SetPlayerArmedWeapon(playerid, 0);
- }
- #endif
- #if defined FP_DRIVEBY_WEAPONS_RESTRICT
- if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
- {
- new playersWeapon = GetPlayerWeapon(playerid), allowedWeapons[15], bool: playerValidWeapon;
- sscanf(FP_DRIVEBY_WEAPONS, "a<i>[15]", allowedWeapons);
- for(new weaponIndex; weaponIndex < sizeof(allowedWeapons); weaponIndex++)
- {
- if((allowedWeapons[weaponIndex] && playersWeapon == allowedWeapons[weaponIndex]) || !playersWeapon)
- {
- playerValidWeapon = true;
- break;
- }
- }
- if(!playerValidWeapon)
- {
- SetPlayerArmedWeapon(playerid, 0);
- }
- }
- #endif
- #if defined FP_NINJA_JACK
- if(newstate == PLAYER_STATE_DRIVER)
- {
- for(new playerIndex; playerIndex < MAX_PLAYERS; playerIndex++)
- {
- if(FP_VehicleJacker[playerIndex] == playerid)
- {
- SetTimerEx("FP_VehicleJackCheck", 1000, 0, "i", playerIndex);
- KillTimer(FP_VehicleJackTimer[playerIndex]);
- FP_VehicleJackTimer[playerIndex] = -1;
- break;
- }
- }
- }
- #endif
- }
- return (funcidx("FP_OnPlayerStateChange") == -1) ? 1 : CallLocalFunction("FP_OnPlayerStateChange", "ddd", playerid, newstate, oldstate);
- }
- #if defined _ALS_OnPlayerStateChange
- #undef OnPlayerStateChange
- #else
- #define _ALS_OnPlayerStateChange
- #endif
- #define OnPlayerStateChange FP_OnPlayerStateChange
- public OnPlayerText(playerid, text[])
- {
- if(!FP_Immune[playerid])
- {
- #if defined FP_SWEARING
- new wordLocation, bool: playerSwearing;
- for(new wordIndex; wordIndex < sizeof(FP_CurseWords); wordIndex++)
- {
- wordLocation = strfind(text, FP_CurseWords[wordIndex], true);
- while(wordLocation > -1)
- {
- playerSwearing = true;
- for(new textIndex = wordLocation; textIndex < wordLocation + strlen(FP_CurseWords[wordIndex]); textIndex++)
- {
- text[textIndex] = '*';
- }
- wordLocation = strfind(text, FP_CurseWords[wordIndex], true, wordLocation);
- }
- }
- if(playerSwearing)
- {
- CallLocalFunction("OnPlayerUnfairPlay", "dd", playerid, FP_SWEARING);
- }
- #endif
- #if defined FP_CHAT_SPAM
- FP_ChatCounter[playerid]++;
- if(FP_ChatCounter[playerid] >= 4)
- {
- FP_ChatCounter[playerid] = 0;
- CallLocalFunction("OnPlayerUnfairPlay", "dd", playerid, FP_CHAT_SPAM);
- }
- else
- {
- SetTimerEx("FP_ReduceChatCounter", 850, 0, "d", playerid);
- }
- #endif
- #if defined FP_SERVER_AD
- new dotCount, colonCount, portCount;
- for(new stringIndex, stringLength = strlen(text); stringIndex < stringLength; stringIndex++)
- {
- if(text[stringIndex] == '.')
- {
- dotCount++;
- }
- else if(text[stringIndex] == ':')
- {
- colonCount++;
- }
- else if(stringIndex + 3 < stringLength)
- {
- if('0' <= text[stringIndex] <= '9' && '0' <= text[stringIndex + 1] <= '9' && '0' <= text[stringIndex + 2] <= '9' && '0' <= text[stringIndex + 3] <= '9')
- {
- portCount++;
- }
- }
- }
- if(dotCount >= 2 && (colonCount || portCount) && strfind(text, FP_SERVER_IP) == -1 && strfind(text, FP_SERVER_DOMAIN, true) == -1)
- {
- CallLocalFunction("OnPlayerUnfairPlay", "dd", playerid, FP_SERVER_AD);
- }
- #endif
- }
- FP_LastUpdate[playerid] = tickcount();
- return (funcidx("FP_OnPlayerText") == -1) ? 1 : CallLocalFunction("FP_OnPlayerText", "ds", playerid, text);
- }
- #if defined _ALS_OnPlayerText
- #undef OnPlayerText
- #else
- #define _ALS_OnPlayerText
- #endif
- #define OnPlayerText FP_OnPlayerText
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if(!FP_Immune[playerid])
- {
- #if defined FP_SWEARING
- new wordLocation, bool: playerSwearing;
- for(new wordIndex; wordIndex < sizeof(FP_CurseWords); wordIndex++)
- {
- wordLocation = strfind(cmdtext, FP_CurseWords[wordIndex], true);
- while(wordLocation > -1)
- {
- playerSwearing = true;
- for(new textIndex = wordLocation; textIndex < wordLocation + strlen(FP_CurseWords[wordIndex]); textIndex++)
- {
- cmdtext[textIndex] = '*';
- }
- wordLocation = strfind(cmdtext, FP_CurseWords[wordIndex], true, wordLocation);
- }
- }
- if(playerSwearing)
- {
- CallLocalFunction("OnPlayerUnfairPlay", "dd", playerid, FP_SWEARING);
- }
- #endif
- #if defined FP_CHAT_SPAM
- FP_ChatCounter[playerid]++;
- if(FP_ChatCounter[playerid] >= 4)
- {
- FP_ChatCounter[playerid] = 0;
- CallLocalFunction("OnPlayerUnfairPlay", "dd", playerid, FP_CHAT_SPAM);
- }
- else
- {
- SetTimerEx("FP_ReduceChatCounter", 850, 0, "d", playerid);
- }
- #endif
- #if defined FP_SERVER_AD
- new dotCount, colonCount, portCount;
- for(new stringIndex, stringLength = strlen(cmdtext); stringIndex < stringLength; stringIndex++)
- {
- if(cmdtext[stringIndex] == '.')
- {
- dotCount++;
- }
- else if(cmdtext[stringIndex] == ':')
- {
- colonCount++;
- }
- else if(stringIndex + 3 < stringLength)
- {
- if('0' <= cmdtext[stringIndex] <= '9' && '0' <= cmdtext[stringIndex + 1] <= '9' && '0' <= cmdtext[stringIndex + 2] <= '9' && '0' <= cmdtext[stringIndex + 3] <= '9')
- {
- portCount++;
- }
- }
- }
- if(dotCount >= 2 && (colonCount || portCount) && strfind(cmdtext, FP_SERVER_IP) == -1 && strfind(cmdtext, FP_SERVER_DOMAIN, true) == -1)
- {
- CallLocalFunction("OnPlayerUnfairPlay", "dd", playerid, FP_SERVER_AD);
- }
- #endif
- }
- FP_LastUpdate[playerid] = tickcount();
- return (funcidx("FP_OnPlayerCommandText") == -1) ? 1 : CallLocalFunction("FP_OnPlayerCommandText", "ds", playerid, cmdtext);
- }
- #if defined _ALS_OnPlayerCommandText
- #undef OnPlayerCommandText
- #else
- #define _ALS_OnPlayerCommandText
- #endif
- #define OnPlayerCommandText FP_OnPlayerCommandText
- public OnPlayerUpdate(playerid)
- {
- FP_TabbedUpdates[playerid] = 0;
- return (funcidx("FP_OnPlayerUpdate") == -1) ? 1 : CallLocalFunction("FP_OnPlayerUpdate", "d", playerid);
- }
- #if defined _ALS_OnPlayerUpdate
- #undef OnPlayerUpdate
- #else
- #define _ALS_OnPlayerUpdate
- #endif
- #define OnPlayerUpdate FP_OnPlayerUpdate
- public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
- {
- if(!FP_Immune[playerid])
- {
- #if defined FP_CAR_RAM
- if(weaponid == 49)
- {
- CallLocalFunction("OnPlayerUnfairPlay", "dd", issuerid, FP_CAR_RAM);
- }
- #endif
- #if defined FP_HELIBLADE
- if(weaponid == 50)
- {
- CallLocalFunction("OnPlayerUnfairPlay", "dd", issuerid, FP_HELIBLADE);
- }
- #endif
- }
- return (funcidx("FP_OnPlayerTakeDamage") == -1) ? 1 : CallLocalFunction("FP_OnPlayerTakeDamage", "ddfd", playerid, issuerid, amount, weaponid);
- }
- #if defined _ALS_OnPlayerTakeDamage
- #undef OnPlayerTakeDamage
- #else
- #define _ALS_OnPlayerTakeDamage
- #endif
- #define OnPlayerTakeDamage FP_OnPlayerTakeDamage
- public OnVehicleMod(playerid, vehicleid, componentid)
- {
- if(!FP_Immune[playerid])
- {
- #if defined FP_VEHICLE_MOD_HACK
- if(!GetPlayerInterior(playerid))
- {
- CallLocalFunction("OnPlayerUnfairPlay", "dd", playerid, FP_VEHICLE_MOD_HACK);
- return 0;
- }
- #endif
- }
- return (funcidx("FP_OnVehicleMod") == -1) ? 1 : CallLocalFunction("FP_OnVehicleMod", "ddd", playerid, vehicleid, componentid);
- }
- #if defined _ALS_OnVehicleMod
- #undef OnVehicleMod
- #else
- #define _ALS_OnVehicleMod
- #endif
- #define OnVehicleMod FP_OnVehicleMod
- public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
- {
- if(!FP_Immune[playerid])
- {
- #if defined FP_NINJA_JACK
- if(!ispassenger)
- {
- for(new playerIndex; playerIndex < MAX_PLAYERS; playerIndex++)
- {
- if(IsPlayerInVehicle(playerIndex, vehicleid) && !GetPlayerVehicleSeat(playerIndex))
- {
- FP_VehicleJacker[playerIndex] = playerid;
- FP_VehicleJackTimer[playerIndex] = SetTimerEx("FP_VehicleJackCheck", 10000, 0, "d", playerIndex);
- break;
- }
- }
- }
- #endif
- }
- return (funcidx("FP_OnPlayerEnterVehicle") == -1) ? 1 : CallLocalFunction("FP_OnPlayerEnterVehicle", "ddd", playerid, vehicleid, ispassenger);
- }
- #if defined _ALS_OnPlayerEnterVehicle
- #undef OnPlayerEnterVehicle
- #else
- #define _ALS_OnPlayerEnterVehicle
- #endif
- #define OnPlayerEnterVehicle FP_OnPlayerEnterVehicle
- stock FP_GivePlayerWeapon(playerid, weaponid, ammo)
- {
- FP_PlayerWeapons[playerid][FP_WeaponSlots[weaponid]] = weaponid;
- return GivePlayerWeapon(playerid, weaponid, ammo);
- }
- #if defined _ALS_GivePlayerWeapon
- #undef GivePlayerWeapon
- #else
- #define _ALS_GivePlayerWeapon
- #endif
- #define GivePlayerWeapon FP_GivePlayerWeapon
- stock FP_ResetPlayerWeapons(playerid)
- {
- for(new weaponIndex; weaponIndex < 13; weaponIndex++)
- {
- FP_PlayerWeapons[playerid][weaponIndex] = 0;
- }
- return ResetPlayerWeapons(playerid);
- }
- #if defined _ALS_ResetPlayerWeapons
- #undef ResetPlayerWeapons
- #else
- #define _ALS_ResetPlayerWeapons
- #endif
- #define ResetPlayerWeapons FP_ResetPlayerWeapons
- stock FP_SetPlayerAmmo(playerid, weapon, ammo)
- {
- if(!ammo)
- {
- FP_PlayerWeapons[playerid][FP_WeaponSlots[weapon]] = 0;
- }
- return SetPlayerAmmo(playerid, weapon, ammo);
- }
- #if defined _ALS_SetPlayerAmmo
- #undef SetPlayerAmmo
- #else
- #define _ALS_SetPlayerAmmo
- #endif
- #define SetPlayerAmmo FP_SetPlayerAmmo
- stock FP_SetPlayerSpecialAction(playerid, actionid)
- {
- if(actionid == SPECIAL_ACTION_USEJETPACK)
- {
- FP_PlayerJetpack[playerid] = true;
- }
- else if(actionid == SPECIAL_ACTION_NONE)
- {
- FP_PlayerJetpack[playerid] = false;
- }
- return SetPlayerSpecialAction(playerid, actionid);
- }
- #if defined _ALS_SetPlayerSpecialAction
- #undef SetPlayerSpecialAction
- #else
- #define _ALS_SetPlayerSpecialAction
- #endif
- #define SetPlayerSpecialAction FP_SetPlayerSpecialAction
- stock FP_ClearAnimations(playerid, forcesync)
- {
- FP_PlayerJetpack[playerid] = false;
- return ClearAnimations(playerid, forcesync);
- }
- #if defined _ALS_ClearAnimations
- #undef ClearAnimations
- #else
- #define _ALS_ClearAnimations
- #endif
- #define ClearAnimations FP_ClearAnimations
- stock FP_SetPlayerPos(playerid, Float: x, Float: y, Float: z)
- {
- FP_LastPositionSet[playerid] = tickcount();
- return SetPlayerPos(playerid, x, y, z);
- }
- #if defined _ALS_SetPlayerPos
- #undef SetPlayerPos
- #else
- #define _ALS_SetPlayerPos
- #endif
- #define SetPlayerPos FP_SetPlayerPos
- stock FP_SetPlayerPosFindZ(playerid, Float: x, Float: y, Float: z)
- {
- FP_LastPositionSet[playerid] = tickcount();
- return SetPlayerPosFindZ(playerid, x, y, z);
- }
- #if defined _ALS_SetPlayerPosFindZ
- #undef SetPlayerPosFindZ
- #else
- #define _ALS_SetPlayerPosFindZ
- #endif
- #define SetPlayerPosFindZ FP_SetPlayerPosFindZ
- stock FP_SetPlayerVelocity(playerid, Float: x, Float: y, Float: z)
- {
- FP_LastPositionSet[playerid] = tickcount();
- return SetPlayerVelocity(playerid, x, y, z);
- }
- #if defined _ALS_SetPlayerVelocity
- #undef SetPlayerVelocity
- #else
- #define _ALS_SetPlayerVelocity
- #endif
- #define SetPlayerVelocity FP_SetPlayerVelocity
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement