06.07.2014, 20:09
Hello, this is my second release, I made a small FS for some annoying exploits/abuses which are being abused in a roleplay server.
So, what does this FS detect?
I'll go past each point and I'll explain how I detect them, and I got a video of them.
Anti G-Bug:
DL: Click here
So, what does this FS detect?
- Anti G-Bug
- Vehicle related bug(with synchronization).
- Anti Car/Planebomb.
- Anti Ninjajack.
- Anti Quickswap.
Code:
RevivePlayer(playerid, bomber(killer), reason) Reason 1 - Died by ninjajack. Reason 2 - Died by carbomb/planebomb. Reason 3 - Died by being ran over by a vehicle. OnPlayerQuickSwap(playerid, weaponid);
Anti G-Bug:
This is easily detected, whenever the callback OnPlayerEnterVehicle gets called, it'll run a two second timer, if the distance between the player and the vehicle is too long, it'll clear the player's animation to prevent him from TP'ing inside the vehicle.Vehicle related bug:
Video: https://www.youtube.com/watch?v=1nfzxu6irp0
I'll first explain the bug, imagine you are driving in a car with one other passenger, if he would tab out, and if you(as the driver) leaves the vehicle, it'll stay at the correct location until the passenger tabs back in, then the vehicle would TP back to the position where he tabbed out.Anti Car/Planebomb:
Those two video's will show it:
Without the fix:
https://www.youtube.com/watch?v=jIVyeGoDlik
With the fix:
https://www.youtube.com/watch?v=j60URVyDqNA
I think I don't have to explain the meaning of the car/planebomb, it'll call this new callback when players died due a bomber: RevivePlayer(playerid, bomber, type), if you got a death system inside of your GM you can revive them, ect.Anti Ninjajack:
Video: https://www.youtube.com/watch?v=xI6o4EJBJH4
When a player dies by being ninja jacked, it'll also call the callback: RevivePlayer(playerid, bomber, reason).Anti Quickswap:
I don't got a video for this but it works, you can be sure about it!
Once a player quickswaps the callback OnPlayerQuickSwap will be called.How to use the callbacks inside of your script:
NOTE: This detection will only be called if a player hit a vehicle/player before swapping his weapons to avoid mass-spamming.
Code:
forward RevivePlayer(playerid, bomber, reason); public RevivePlayer(playerid, bomber, reason) { new string[128]; switch (reason) { case 1: format(string, sizeof(string), "WARNING: %s has been ninja-jacked by %s.", PlayerRPName(playerid), PlayerRPName(bomber)); case 2: format(string, sizeof(string), "WARNING: %s has been bombed by %s.", PlayerRPName(playerid), PlayerRPName(bomber)); case 3: format(string, sizeof(string), "WARNING: %s has been car rammed/helibladed to death by %s.", PlayerRPName(playerid), PlayerRPName(bomber)); } if (!CharacterData[playerid][pAdmin]) SendAdminMessage(YELLOW, string); return 1; }