Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- /*
- *
- * "Anti Glitch"
- * by [S]trong
- *
- *
- */
- stock
- AG_fireTick[MAX_PLAYERS],
- AG_crouchTick[MAX_PLAYERS]
- ;
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) {
- if((oldkeys & KEY_FIRE) && !(newkeys & KEY_FIRE)) {
- switch(GetPlayerWeapon(playerid)) {
- case 22 .. 25, 27, 29 .. 31, 33, 34: { // Armas que queira proibir o c-bug...
- AG_fireTick[playerid] = GetTickCount();
- }
- }
- }
- }
- public OnPlayerUpdate(playerid) {
- new
- iVar = GetTickCount()
- ;
- if(((iVar - AG_fireTick[playerid]) < 520 && (AG_crouchTick[playerid] < iVar) && (GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK))) {
- switch(GetPlayerCameraMode(playerid)) {
- case 4, 53, 7: { // 7 para detectar na sniper também...
- new
- iKey,
- iCheck
- ;
- GetPlayerKeys(playerid, iKey, iCheck, iCheck);
- if((iKey & KEY_CROUCH)) {
- AG_crouchTick[playerid] = iVar + 520; // não deixar o comando floodar...
- CallRemoteFunction("OnPlayerGlitch", "i", playerid);
- }
- }
- }
- }
- }
- forward OnPlayerGlitch(playerid);
- public OnPlayerGlitch(playerid) { // Callback chamada quando o jogador faz glitch...
- new
- Float:fCoords[3]
- ;
- GetPlayerPos(playerid, fCoords[0], fCoords[1], fCoords[2]);
- SetPlayerPos(playerid, fCoords[0], fCoords[1], fCoords[2] + 1.0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement