Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Данный FS исправляет/запрещает использовать баги SA-MP:
- Данная версия скрипта включает в себя:
- BannyHop fix
- SpawnMoney fix
- DialogCrush fix
- DialogColor fix
- +C fix
- Slide fix
- Sprint fix
- Knife Bug fix
- Knife Kill fix
- Автор FS: Kamox
- Skype: k.amox
- Mail: [email protected]
- Дата: 17.07.2012г
- */
- #include <a_samp>
- #define FREEZE_TIME 3000
- enum fixInfo
- {
- bool:fixBannyHop,
- bool:fixSpawnMoney,
- bool:fixDialogCrush,
- bool:fixDialogColor,
- bool:fixCBug,
- bool:fixSlideBug,
- bool:fixSprintBug,
- bool:fixKnifeBug,
- bool:fixKnifeKill
- }
- new FixInfo[fixInfo] =
- {
- true, //BannyHop fix (Бег с прыжками)
- true, //SpawnMoney fix (При спавне снимает $100)
- true, //DialogCrush fix (Можно положить сервер вводя в диалоговое окно символ '%')
- true, //DialogColor fix (Можно менять цвет текста встявляя коды цветов "{33CCFF}")
- true, //C Bug fix (Баг со стрельбой с дигла)
- true, //Slide fix (Езда с диглом)
- true, //Sprint Bug fix (Быстрый бег многократным нажатием пробела)
- true, //KnifeBug fix (Баг с ножом, когда у одного игрока видно, что другой игрок лежит)
- true //KnifeKill fix (Этим багом можно убить игрока ножом на ходу
- };
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" Fix script by Kamox");
- print("--------------------------------------\n");
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- SetPVarInt(playerid, "BHTime", -1);
- SetPVarInt(playerid, "MoneyTime", -1);
- SetPVarInt(playerid, "CBugTime", -1);
- SetPVarInt(playerid, "UnfreezeTime", -1);
- SetPVarInt(playerid, "SlideTime", -1);
- SetPVarInt(playerid, "SprintCount", -1);
- SetPVarInt(playerid, "SprintTime", -1);
- SetPVarInt(playerid, "KnifeTime", -1);
- SetPVarInt(playerid, "KnifePlayer", INVALID_PLAYER_ID);
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- if(FixInfo[fixSpawnMoney] && GetPVarInt(playerid, "MoneyTime") != -1)
- {
- if(GetTickCount() > GetPVarInt(playerid, "MoneyTime"))
- {
- GivePlayerMoney(playerid, 100);
- }
- }
- SetPVarInt(playerid, "MoneyTime", -1);
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- if(FixInfo[fixSpawnMoney])
- {
- SetPVarInt(playerid, "MoneyTime", GetTickCount() + 2000);
- }
- return 1;
- }
- stock BugFreezePlayer(playerid, time)
- {
- SetPVarInt(playerid, "UnfreezeTime", time);
- TogglePlayerControllable(playerid, 0);
- return true;
- }
- stock GetPlayerSpeed(playerid)
- {
- new Float:X, Float:Y, Float:Z;
- GetPlayerVelocity(playerid, X, Y, Z);
- return floatround( floatsqroot( X * X + Y * Y + Z * Z ) * 170.0 );
- }
- stock CheckDialogColor(text[], first, end)
- {
- if(text[first] != '{' || text[end] != '}') return false;
- for(new i = first; i <= end; i ++)
- {
- if(text[i] >= '0' && text[i] <= '9') continue;
- if(text[i] >= 'a' && text[i] <= 'f') continue;
- if(text[i] >= 'A' && text[i] <= 'F') continue;
- return false;
- }
- strdel(text, first, end + 1);
- return true;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- if(FixInfo[fixBannyHop])
- {
- new tick = GetTickCount();
- if(oldkeys & KEY_SPRINT)
- {
- SetPVarInt(playerid, "BHTime", tick + 250);
- }
- if(newkeys & KEY_JUMP)
- {
- if(tick < GetPVarInt(playerid, "BHTime"))
- {
- ClearAnimations(playerid);
- BugFreezePlayer(playerid, tick + FREEZE_TIME);
- }
- SetPVarInt(playerid, "BHTime", -1);
- }
- }
- if(FixInfo[fixKnifeBug] || FixInfo[fixKnifeKill])
- {
- if(newkeys & KEY_FIRE && oldkeys & 128)
- {
- if(GetPlayerWeapon(playerid) == 4)
- {
- if(GetPlayerAnimationIndex(playerid) == 747)
- {
- new knifeid = GetPlayerTargetPlayer(playerid);
- if(knifeid != INVALID_PLAYER_ID)
- {
- if(FixInfo[fixKnifeKill] && GetPlayerSpeed(playerid) > 10)
- {
- ClearAnimations(playerid);
- ClearAnimations(knifeid);
- }
- else if(FixInfo[fixKnifeBug])
- {
- new time = GetPlayerPing(playerid) + GetPlayerPing(knifeid);
- SetPVarInt(knifeid, "KnifePlayer", playerid);
- SetPVarInt(knifeid, "KnifeTime", GetTickCount() + time);
- }
- }
- }
- }
- }
- }
- if(FixInfo[fixSprintBug])
- {
- if(newkeys & KEY_SPRINT)
- {
- new tick = GetTickCount();
- if(GetPVarInt(playerid, "SprintTime") == -1 || tick < GetPVarInt(playerid, "SprintTime"))
- {
- if(GetPlayerSpeed(playerid) > 15)
- {
- if(GetPVarInt(playerid, "SprintCount") >= 5)
- {
- SetPVarInt(playerid, "SprintCount", -1);
- SetPVarInt(playerid, "SprintTime", -1);
- BugFreezePlayer(playerid, tick + FREEZE_TIME);
- }
- else
- {
- SetPVarInt(playerid, "SprintCount", GetPVarInt(playerid, "SprintCount") + 1);
- SetPVarInt(playerid, "SprintTime", tick + 200);
- }
- }
- }
- else if(tick - GetPVarInt(playerid, "SprintTime") > 1000)
- {
- SetPVarInt(playerid, "SprintCount", -1);
- SetPVarInt(playerid, "SprintTime", -1);
- }
- }
- }
- if(FixInfo[fixCBug])
- {
- if(GetPlayerWeapon(playerid) > 21)
- {
- new tick = GetTickCount();
- if(oldkeys & KEY_FIRE) SetPVarInt(playerid, "CBugTime", tick + 500);
- if(newkeys & KEY_CROUCH)
- {
- if(tick < GetPVarInt(playerid, "CBugTime"))
- {
- SetPlayerArmedWeapon(playerid, 0);
- BugFreezePlayer(playerid, tick + FREEZE_TIME);
- }
- SetPVarInt(playerid, "CBugTime", -1);
- }
- }
- }
- if(FixInfo[fixSlideBug])
- {
- new tick = GetTickCount();
- new FIRE_WEAPON = GetPlayerWeapon(playerid) > 21;
- if(oldkeys & KEY_SPRINT && FIRE_WEAPON)
- {
- new keys, ud, lr;
- GetPlayerKeys(playerid, keys, ud, lr);
- if(ud != 0 || lr != 0)
- {
- SetPVarInt(playerid, "SlideTime", tick + 500);
- }
- }
- if( (newkeys & KEY_FIRE || newkeys & 128) && FIRE_WEAPON )
- {
- if(tick < GetPVarInt(playerid, "SlideTime"))
- {
- SetPlayerArmedWeapon(playerid, 0);
- BugFreezePlayer(playerid, tick + FREEZE_TIME);
- }
- SetPVarInt(playerid, "SlideTime", -1);
- }
- }
- return 1;
- }
- public OnPlayerUpdate(playerid)
- {
- if(GetPVarInt(playerid, "UnfreezeTime") != -1)
- {
- if(GetTickCount() > GetPVarInt(playerid, "UnfreezeTime"))
- {
- SetPVarInt(playerid, "UnfreezeTime", -1);
- TogglePlayerControllable(playerid, 1);
- }
- }
- if(GetPVarInt(playerid, "KnifeTime") != -1)
- {
- if(GetPlayerAnimationIndex(playerid) == 745)
- {
- SetPVarInt(playerid, "KnifeTime", -1);
- SetPVarInt(playerid, "KnifePlayer", INVALID_PLAYER_ID);
- }
- else if(GetTickCount() > GetPVarInt(playerid, "KnifeTime"))
- {
- SetPVarInt(playerid, "KnifeTime", -1);
- SetPVarInt(playerid, "KnifePlayer", INVALID_PLAYER_ID);
- ClearAnimations(playerid);
- }
- }
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- for(new i, s = strlen(inputtext); i < s; i ++)
- {
- if(FixInfo[fixDialogCrush] && inputtext[i] == '%') inputtext[i] = '#';
- if(FixInfo[fixDialogColor] && inputtext[i] == '{') CheckDialogColor(inputtext, i, i + 7);
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment