Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- ControlCheats - Administre diversos cheats facilmente
- Creator: steak
- Credits: Y_Less (ALS Hook), Bruno e Paulor ( Lógicas(pbAntiCheater) ), cessil (Lógicas)
- Version: 1.5
- Last Update: 06/04/2013, 07/04/2013, 09/04/2013
- */
- #include <a_samp>
- #if defined _ControlCheats_include
- #endinput
- #endif
- #define _ControlCheats_include
- //statics
- static
- _registerlastIPEx[16],
- p_IsInVehicle[MAX_PLAYERS],
- v_PlayerInVehicle[MAX_VEHICLES],
- p_VehicleEnterTime[MAX_PLAYERS],
- g_MassTpDelay,
- SERVER_SIDE_DELAY,
- p_SpawnTime[MAX_PLAYERS],
- registerMaxConnect,
- lastconnect,
- bool:p_SkipNextAB[MAX_PLAYERS],
- bool:_OPCN,
- bool:_OPUP,
- bool:_OPSC,
- bool:_OPDT,
- bool:_OPTX,
- bool:_OPDC,
- bool:_OPSP
- ;
- //definições de configuração
- #define INVALID_CHAT_BLOCK \
- true // -- Mude para "false" se quiser que o texto flood/invalid digitado apareça.
- #define SAVE_LOG \
- true // -- Mude para "false" caso não queira log.
- #define INVALID_FILE \
- "/%s.txt" // -- Mude o diretorio(se quiser).
- #define INVALID_MAX_PING \
- (900) // -- Mude "0900" para o limite de ping ao seu gosto.
- #define MAX_SPEED \
- (350) // -- Mude "0350" para o limite de velocidade ao seu gosto.
- #define MAX_TIME_TEXT \
- (0003) // -- Mude "0003" para o limite de tempo entre cada texto ao seu gosto.
- #define MAX_PINGS_WARNS \
- (0002) // -- Numero maximo de avisos de ping alto.. caso passar desse limite é chamada a "PLAYER_ONPING_HIGH"
- #define MAX_CONNECTIONS \
- (0002) // -- Numero maximo de conexões com o mesmo ip em menos ou igual que "MAX_TIME_CONNECTIONS"
- #define MAX_TIME_CONNECTIONS \
- (0005) // -- Conexões em menos de "0005" segundos.
- #define MAX_ALT_FLY \
- (5.0) // -- Altura máxima para detectar um fly caso for maior que isso é chamada a "PLAYER_ONFLY_HACK".
- #define MAX_DEATHS_FLOOD \
- (0002) // -- Caso o max deaths for maior que isso em menos de "MAX_TIME_FLOOD"..
- #define MAX_TIME_FLOOD \
- (0003) // -- Tempo max de flood death
- //forwards
- forward
- OnPlayerControllingCheat(playerid, cheatid)
- ;
- forward
- OnRegisterUpdate(PLAYER_ID)
- ;
- forward
- OnRegisterBot(playerid)
- ;
- forward
- OnRegisterPlayer(playerid)
- ;
- //Enumeração hack
- enum {
- //Floods..
- PLAYER_ONTEXT_FLOOD,
- PLAYER_ONCONNECT_FLOOD,
- //Cleo4..
- PLAYER_ONSTATE_HACK_1,
- PLAYER_ONSTATE_HACK_2,
- PLAYER_ONSTATE_HACK_3,
- PLAYER_ONDEATH_HACK,
- //Outros..
- PLAYER_ONPING_HIGH,
- PLAYER_ONFLY_HACK,
- PLAYER_ONMONEY_HACK,
- PLAYER_ONSCORE_HACK,
- PLAYER_ONAMMO_HACK, //Removido -- Temporariamente
- PLAYER_ONWEAP_HACK,
- PLAYER_ONSPEED_HACK_1,
- PLAYER_ONSPEED_HACK_2,
- //Airbreak/CarTele
- PLAYER_ONBREAKCAR_HACK_1,
- PLAYER_ONBREAKCAR_HACK_2,
- PLAYER_ONBREAKCAR_HACK_3,
- PLAYER_ONBREAKCAR_HACK_4,
- PLAYER_ONBREAK_HACK_1,
- PLAYER_ONBREAK_HACK_2,
- PLAYER_ONBREAK_HACK_3,
- PLAYER_ONBREAK_HACK_4
- };
- enum st_AIRBREAKMETER {
- LastMeasured,
- Float:lastX,
- Float:lastY,
- Float:lastZ,
- Float:newX,
- Float:newY,
- Float:newZ
- };
- new p_AirBrkCheck[MAX_PLAYERS][st_AIRBREAKMETER];
- //Float
- new
- Float:MaxVehicleSpeed[612] = {
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 260.00,
- 160.00,
- 160.00,
- 200.00,
- 120.00,
- 150.00,
- 165.00,
- 110.00,
- 170.00,
- 110.00,
- 180.00,
- 160.00,
- 240.00,
- 160.00,
- 160.00,
- 140.00,
- 230.00,
- 155.00,
- 200.00,
- 150.00,
- 160.00,
- 180.00,
- 180.00,
- 165.00,
- 145.00,
- 170.00,
- 200.00,
- 200.00,
- 170.00,
- 170.00,
- 200.00,
- 190.00,
- 130.00,
- 170.00,
- 180.00,
- 200.00,
- 120.00,
- 160.00,
- 160.00,
- 160.00,
- 160.00,
- 160.00,
- 75.00,
- 150.00,
- 150.00,
- 110.00,
- 165.00,
- 190.00,
- 200.00,
- 190.00,
- 150.00,
- 120.00,
- 240.00,
- 190.00,
- 190.00,
- 190.00,
- 140.00,
- 160.00,
- 160.00,
- 165.00,
- 160.00,
- 200.00,
- 190.00,
- 260.00,
- 190.00,
- 75.00,
- 75.00,
- 160.00,
- 160.00,
- 190.00,
- 200.00,
- 170.00,
- 160.00,
- 190.00,
- 190.00,
- 160.00,
- 160.00,
- 200.00,
- 200.00,
- 150.00,
- 165.00,
- 200.00,
- 120.00,
- 150.00,
- 120.00,
- 190.00,
- 160.00,
- 100.00,
- 200.00,
- 200.00,
- 170.00,
- 170.00,
- 160.00,
- 160.00,
- 190.00,
- 220.00,
- 170.00,
- 200.00,
- 200.00,
- 140.00,
- 140.00,
- 160.00,
- 75.00,
- 260.00,
- 260.00,
- 160.00,
- 260.00,
- 230.00,
- 165.00,
- 140.00,
- 120.00,
- 140.00,
- 200.00,
- 200.00,
- 200.00,
- 120.00,
- 120.00,
- 165.00,
- 165.00,
- 160.00,
- 340.00,
- 340.00,
- 190.00,
- 190.00,
- 190.00,
- 110.00,
- 160.00,
- 160.00,
- 160.00,
- 170.00,
- 160.00,
- 60.00,
- 70.00,
- 140.00,
- 200.00,
- 160.00,
- 160.00,
- 160.00,
- 110.00,
- 110.00,
- 150.00,
- 160.00,
- 230.00,
- 160.00,
- 165.00,
- 260.00,
- 160.00,
- 160.00,
- 160.00,
- 200.00,
- 160.00,
- 160.00,
- 165.00,
- 160.00,
- 200.00,
- 170.00,
- 180.00,
- 110.00,
- 110.00,
- 200.00,
- 200.00,
- 200.00,
- 200.00,
- 200.00,
- 200.00,
- 75.00,
- 200.00,
- 160.00,
- 160.00,
- 170.00,
- 110.00,
- 110.00,
- 90.00,
- 60.00,
- 110.00,
- 60.00,
- 160.00,
- 160.00,
- 200.00,
- 110.00,
- 160.00,
- 165.00,
- 190.00,
- 160.00,
- 170.00,
- 120.00,
- 165.00,
- 260.00,
- 200.00,
- 140.00,
- 200.00,
- 260.00,
- 120.00,
- 200.00,
- 200.00,
- 60.00,
- 190.00,
- 200.00,
- 200.00,
- 200.00,
- 160.00,
- 165.00,
- 110.00,
- 200.00,
- 200.00,
- 260.00,
- 260.00,
- 160.00,
- 160.00,
- 160.00,
- 140.00,
- 160.00,
- 260.00
- };
- //publics
- public OnPlayerDeath(playerid, killerid, reason) {
- if(gettime() - GetPVarInt(playerid, #registerLastDeath) < MAX_TIME_FLOOD && GetPVarInt(playerid, #registerDeaths) > MAX_DEATHS_FLOOD) {
- DeletePVar(playerid, #registerLastDeath);
- DeletePVar(playerid, #registerDeaths);
- #if SAVE_LOG == true
- //Save File
- static
- strins_[128],
- strins_name[MAX_PLAYER_NAME]
- ;
- GetPlayerName(playerid, strins_name, sizeof(strins_name));
- format(strins_, sizeof(strins_), "%s usou fake-kill", strins_name);
- CriarLog_Cheats("UsaramFakeKill", strins_);
- #endif
- //busted
- CallLocalFunction(#OnPlayerControllingCheat, #ii, playerid, PLAYER_ONDEATH_HACK);
- }
- SetPVarInt(playerid, #registerLastDeath, gettime());
- SetPVarInt(playerid, #registerDeaths, GetPVarInt(playerid, #registerDeaths) +1);
- return (_OPDT ? CallLocalFunction(#_OnPlayerDeathEx, #iii, playerid, killerid, reason) : 1);
- }
- #if defined _ALS_OnPlayerDeath
- #undef OnPlayerDeath
- #else
- #define _ALS_OnPlayerDeath
- #endif
- #define OnPlayerDeath _OnPlayerDeathEx
- forward _OnPlayerDeathEx(playerid, killerid, reason);
- public OnPlayerStateChange(playerid, newstate, oldstate) {
- p_IsInVehicle[playerid] = GetPlayerVehicleID(playerid);
- if(newstate == PLAYER_STATE_DRIVER) {
- v_PlayerInVehicle[p_IsInVehicle[playerid]] = playerid;
- if(oldstate == PLAYER_STATE_DRIVER) {
- if((GetTickCount() - p_VehicleEnterTime[playerid]) < g_MassTpDelay) {
- p_VehicleEnterTime[playerid] = GetTickCount();
- #if SAVE_LOG == true
- //Save File
- static
- strins_[128],
- strins_name[MAX_PLAYER_NAME]
- ;
- GetPlayerName(playerid, strins_name, sizeof(strins_name));
- format(strins_, sizeof(strins_), "%s usou cheat de puxar varios veiculos", strins_name);
- CriarLog_Cheats("UsaramCleo4", strins_);
- #endif
- //busted
- CallLocalFunction(#OnPlayerControllingCheat, #ii, playerid, PLAYER_ONSTATE_HACK_1);
- return true;
- }
- }
- p_VehicleEnterTime[playerid] = GetTickCount();
- for(new i = 0; i < MAX_PLAYERS; i++) {
- if(!IsPlayerConnected(i)) continue;
- if(p_IsInVehicle[playerid] == p_IsInVehicle[i] && GetPlayerState(i) == PLAYER_STATE_ONFOOT) {
- #if SAVE_LOG == true
- //Save File
- static
- strins_[128],
- strins_name[MAX_PLAYER_NAME]
- ;
- GetPlayerName(playerid, strins_name, sizeof(strins_name));
- format(strins_, sizeof(strins_), "%s usou CarJackHack", strins_name);
- CriarLog_Cheats("UsaramCleo4", strins_);
- #endif
- //busted
- CallLocalFunction(#OnPlayerControllingCheat, #ii, playerid, PLAYER_ONSTATE_HACK_2);
- return true;
- }
- }
- }
- else {
- if(p_IsInVehicle[playerid] != 0) {
- v_PlayerInVehicle[p_IsInVehicle[playerid]] = -1;
- p_IsInVehicle[playerid] = 0;
- }
- if(oldstate == PLAYER_STATE_DRIVER) {
- if((GetTickCount() - p_VehicleEnterTime[playerid]) < g_MassTpDelay) {
- #if SAVE_LOG == true
- //Save File
- static
- strins_[128],
- strins_name[MAX_PLAYER_NAME]
- ;
- GetPlayerName(playerid, strins_name, sizeof(strins_name));
- format(strins_, sizeof(strins_), "%s usou cheat de puxar varios veiculos", strins_name);
- CriarLog_Cheats("UsaramCleo4", strins_);
- #endif
- //busted
- CallLocalFunction(#OnPlayerControllingCheat, #ii, playerid, PLAYER_ONSTATE_HACK_3);
- return true;
- }
- }
- }
- return (_OPSC ? CallLocalFunction(#_OnPlayerStateChangeEx, #iii, playerid, newstate, oldstate) : 1);
- }
- #if defined _ALS_OnPlayerStateChange
- #undef OnPlayerStateChange
- #else
- #define _ALS_OnPlayerStateChange
- #endif
- #define OnPlayerStateChange _OnPlayerStateChangeEx
- forward _OnPlayerStateChangeEx(playerid, newstate, oldstate);
- public OnPlayerUpdate(playerid) {
- static
- Float:posFly[3]
- ;
- GetPlayerPos(playerid, posFly[0], posFly[1], posFly[2]);
- if(posFly[2] > MAX_ALT_FLY && _isPlayerUsingSwimAnimEx(playerid) && !_isPlayerInWaterEx(playerid)) {
- #if SAVE_LOG == true
- //Save File
- static
- strins_[128],
- strins_name[MAX_PLAYER_NAME]
- ;
- GetPlayerName(playerid, strins_name, sizeof(strins_name));
- format(strins_, sizeof(strins_), "%s usou fly", strins_name);
- CriarLog_Cheats("UsaramFLY", strins_);
- #endif
- //busted
- CallLocalFunction(#OnPlayerControllingCheat, #ii, playerid, PLAYER_ONFLY_HACK);
- }
- static
- _weapSlotEx[2],
- str_weap[13]
- ;
- for(new x = 0; x < 13; x++) {
- GetPlayerWeaponData(playerid, x, _weapSlotEx[0], _weapSlotEx[1]);
- format(str_weap, sizeof(str_weap), "weap%d", x);
- if(_weapSlotEx[0] < 47 && GetPVarInt(playerid, str_weap) != _weapSlotEx[0] && _weapSlotEx[0]) {
- #if SAVE_LOG == true
- //Save File
- static
- strins_[128],
- strins_name[MAX_PLAYER_NAME]
- ;
- GetPlayerName(playerid, strins_name, sizeof(strins_name));
- format(strins_, sizeof(strins_), "%s arma hack", strins_name);
- CriarLog_Cheats("UsaramArmaHack", strins_);
- #endif
- //busted
- DeletePVar(playerid, str_weap);
- CallLocalFunction(#OnPlayerControllingCheat, #ii, playerid, PLAYER_ONWEAP_HACK);
- }
- }
- if(GetPVarInt(playerid, #warnHighPing) > MAX_PINGS_WARNS) {
- #if SAVE_LOG == true
- //Save File
- static
- strins_[128],
- strins_name[MAX_PLAYER_NAME]
- ;
- GetPlayerName(playerid, strins_name, sizeof(strins_name));
- format(strins_, sizeof(strins_), "%s ping alto", strins_name);
- CriarLog_Cheats("PingAlto", strins_);
- #endif
- //busted
- DeletePVar(playerid, #warnHighPing);
- CallLocalFunction(#OnPlayerControllingCheat, #ii, playerid, PLAYER_ONPING_HIGH);
- }
- new
- _moneyHack = GetPlayerMoney(playerid)
- ;
- if(_moneyHack > GetPVarInt(playerid, #registermaxMoney)) {
- #if SAVE_LOG == true
- //Save File
- static
- strins_[128],
- strins_name[MAX_PLAYER_NAME]
- ;
- GetPlayerName(playerid, strins_name, sizeof(strins_name));
- format(strins_, sizeof(strins_), "%s usou money hack", strins_name);
- CriarLog_Cheats("UsaramMoneyHack", strins_);
- #endif
- //busted
- DeletePVar(playerid, #registermaxMoney);
- DeletePVar(playerid, #registerMoney);
- CallLocalFunction(#OnPlayerControllingCheat, #ii, playerid, PLAYER_ONMONEY_HACK);
- }
- new
- _scoreHack = GetPlayerScore(playerid)
- ;
- if(_scoreHack > GetPVarInt(playerid, #registermaxScore)) {
- #if SAVE_LOG == true
- //Save File
- static
- strins_[128],
- strins_name[MAX_PLAYER_NAME]
- ;
- GetPlayerName(playerid, strins_name, sizeof(strins_name));
- format(strins_, sizeof(strins_), "%s usou score hack", strins_name);
- CriarLog_Cheats("UsaramScoreHack", strins_);
- #endif
- //busted
- DeletePVar(playerid, #registermaxScore);
- DeletePVar(playerid, #registerScore);
- CallLocalFunction(#OnPlayerControllingCheat, #ii, playerid, PLAYER_ONSCORE_HACK);
- }
- return (_OPUP ? CallLocalFunction(#_OnPlayerUpdateEx, #i, playerid) : 1);
- }
- #if defined _ALS_OnPlayerUpdate
- #undef OnPlayerUpdate
- #else
- #define _ALS_OnPlayerUpdate
- #endif
- #define OnPlayerUpdate _OnPlayerUpdateEx
- forward _OnPlayerUpdateEx(playerid);
- public OnPlayerText(playerid, text[]) {
- if(gettime() - GetPVarInt(playerid, #registerLastText) < MAX_TIME_TEXT) {
- #if SAVE_LOG == true
- //Save File
- static
- strins_[128],
- strins_name[MAX_PLAYER_NAME]
- ;
- GetPlayerName(playerid, strins_name, sizeof(strins_name));
- format(strins_, sizeof(strins_), "%s floodou o chat", strins_name);
- CriarLog_Cheats("FlodaramChat", strins_);
- #endif
- //busted
- DeletePVar(playerid, #registerLastText);
- CallLocalFunction(#OnPlayerControllingCheat, #ii, playerid, PLAYER_ONTEXT_FLOOD);
- #if INVALID_CHAT_BLOCK == true
- return false;
- #endif
- }
- SetPVarInt(playerid, #registerLastText, gettime());
- return (_OPTX ? CallLocalFunction(#_OnPlayerTextEx, #is, playerid, text) : 1);
- }
- #if defined _ALS_OnPlayerText
- #undef OnPlayerText
- #else
- #define _ALS_OnPlayerText
- #endif
- #define OnPlayerText _OnPlayerTextEx
- forward _OnPlayerTextEx(playerid, text[]);
- public OnGameModeInit() {
- _OPCN = funcidx(#_OnPlayerConnectEx) != -1;
- _OPUP = funcidx(#_OnPlayerUpdateEx) != -1;
- _OPSC = funcidx(#_OnPlayerStateChangeEx) != -1;
- _OPDT = funcidx(#_OnPlayerDeathEx) != -1;
- _OPTX = funcidx(#_OnPlayerTextEx) != -1;
- _OPSP = funcidx(#_OnPlayerSpawnEx) != -1;
- _OPDC = funcidx(#_OnPlayerDisconnectEx) != -1;
- g_MassTpDelay = 150;
- SetTimer(#OnRegisterUpdate, 1000, true);
- return CallLocalFunction(#_OnGameModeInitEx, #);
- }
- #if defined _ALS_OnGameModeInit
- #undef OnGameModeInit
- #else
- #define _ALS_OnGameModeInit
- #endif
- #define OnGameModeInit _OnGameModeInitEx
- forward _OnGameModeInitEx();
- public OnPlayerConnect(playerid) {
- CallLocalFunction(#OnRegisterPlayer, #i, playerid);
- return (_OPCN ? CallLocalFunction(#_OnPlayerConnectEx, #i, playerid) : 1);
- }
- #if defined _ALS_OnPlayerConnect
- #undef OnPlayerConnect
- #else
- #define _ALS_OnPlayerConnect
- #endif
- #define OnPlayerConnect _OnPlayerConnectEx
- forward _OnPlayerConnectEx(playerid);
- public OnPlayerSpawn(playerid) {
- p_SpawnTime[playerid] = GetTickCount();
- p_AirBrkCheck[playerid][LastMeasured] = p_SpawnTime[playerid];
- GetPlayerPos(playerid, p_AirBrkCheck[playerid][lastX], p_AirBrkCheck[playerid][lastY], p_AirBrkCheck[playerid][lastZ]);
- p_AirBrkCheck[playerid][lastX] = p_AirBrkCheck[playerid][newX] + Float:0.2;
- p_AirBrkCheck[playerid][lastY] = p_AirBrkCheck[playerid][newY] + Float:0.2;
- p_AirBrkCheck[playerid][lastZ] = p_AirBrkCheck[playerid][newZ] + Float:0.2;
- return (_OPSP ? CallLocalFunction(#_OnPlayerSpawnEx, #i, playerid) : 1);
- }
- #if defined _ALS_OnPlayerSpawn
- #undef OnPlayerSpawn
- #else
- #define _ALS_OnPlayerSpawn
- #endif
- #define OnPlayerSpawn _OnPlayerSpawnEx
- forward _OnPlayerSpawnEx(playerid);
- public OnPlayerDisconnect(playerid, reason) {
- p_SkipNextAB[playerid] = false;
- return (_OPDC ? CallLocalFunction(#_OnPlayerDisconnectEx, #ii, playerid, reason) : 1);
- }
- #if defined _ALS_OnPlayerDisconnect
- #undef OnPlayerDisconnect
- #else
- #define _ALS_OnPlayerDisconnect
- #endif
- #define OnPlayerDisconnect _OnPlayerDisconnectEx
- forward _OnPlayerDisconnectEx(playerid, reason);
- public OnRegisterBot(playerid) {
- registerMaxConnect++;
- if(registerMaxConnect > MAX_CONNECTIONS) {
- #if SAVE_LOG == true
- //Save File
- static
- strins_[128],
- strins_name[MAX_PLAYER_NAME]
- ;
- GetPlayerName(playerid, strins_name, sizeof(strins_name));
- format(strins_, sizeof(strins_), "%s usou bot", strins_name);
- CriarLog_Cheats("UsaramBOT", strins_);
- #endif
- //busted
- CallLocalFunction(#OnPlayerControllingCheat, #ii, playerid, PLAYER_ONCONNECT_FLOOD);
- }
- return true;
- }
- public OnRegisterPlayer(playerid) {
- if(strcmp(_registerIPEx(playerid), _registerlastIPEx, true) == 0 && SERVER_SIDE_DELAY - lastconnect <= MAX_TIME_CONNECTIONS) OnRegisterBot(playerid); else registerMaxConnect = 0;
- if(strcmp(_registerIPEx(playerid), "255.255.255.255", true) == 0) print("INVALID_IP"); else format(_registerlastIPEx, sizeof(_registerlastIPEx), "%s", _registerIPEx(playerid));
- lastconnect = SERVER_SIDE_DELAY;
- p_VehicleEnterTime[playerid] = GetTickCount();
- return true;
- }
- public OnRegisterUpdate(PLAYER_ID) {
- if(GetPlayerPing(PLAYER_ID) > INVALID_MAX_PING) {
- SetPVarInt(PLAYER_ID, #warnHighPing, GetPVarInt(PLAYER_ID, #warnHighPing) +1);
- }
- else DeletePVar(PLAYER_ID, #warnHighPing);
- SERVER_SIDE_DELAY++;
- new
- Float:SPEEDx = Float:0.0,
- Float:SPEEDu = Float:0.0,
- playerid = 0
- ;
- static
- Float:VEC[3],
- bool:Checks[3],
- diff
- ;
- for(new i = 0; i < MAX_PLAYERS; i++) {
- if(!IsPlayerConnected(i)) continue;
- i = playerid;
- new
- OnState = GetPlayerState(playerid)
- ;
- if(OnState == PLAYER_STATE_DRIVER) {
- static
- Float:s[3]
- ;
- GetVehicleVelocity(GetPlayerVehicleID(playerid), s[0], s[1], s[2]);
- s[0] *= s[0];
- s[1] *= s[1];
- if(s[2] < Float:-0.023) {
- if(floatsqroot(s[0]+s[1])* Float:174.0 > (MaxVehicleSpeed[GetVehicleModel(GetPlayerVehicleID(playerid))]+ Float:10.00)) {
- #if SAVE_LOG == true
- //Save File
- static
- strins_[128],
- strins_name[MAX_PLAYER_NAME]
- ;
- GetPlayerName(playerid, strins_name, sizeof(strins_name));
- format(strins_, sizeof(strins_), "%s usou speed-hack", strins_name);
- CriarLog_Cheats("UsaramSpeedHack", strins_);
- #endif
- //busted
- CallLocalFunction(#OnPlayerControllingCheat, #ii, playerid, PLAYER_ONSPEED_HACK_1);
- }
- }
- else {
- s[2] *= s[2];
- if(floatsqroot(s[0]+s[1]+s[2])* Float:174.0 > (MaxVehicleSpeed[GetVehicleModel(GetPlayerVehicleID(playerid))]+ Float:10.00)) {
- #if SAVE_LOG == true
- //Save File
- static
- strins_[128],
- strins_name[MAX_PLAYER_NAME]
- ;
- GetPlayerName(playerid, strins_name, sizeof(strins_name));
- format(strins_, sizeof(strins_), "%s usou speed-hack", strins_name);
- CriarLog_Cheats("UsaramSpeedHack", strins_);
- #endif
- //busted
- CallLocalFunction(#OnPlayerControllingCheat, #ii, playerid, PLAYER_ONSPEED_HACK_2);
- }
- }
- }
- diff = GetTickCount() - p_AirBrkCheck[playerid][LastMeasured];
- switch(OnState) {
- case PLAYER_STATE_ONFOOT: {
- GetPlayerVelocity(playerid, VEC[0], VEC[1], VEC[2]);
- GetPlayerPos(playerid, p_AirBrkCheck[playerid][newX], p_AirBrkCheck[playerid][newY], p_AirBrkCheck[playerid][newZ]);
- Checks[2] = GetPlayerSurfingObjectID(playerid) == INVALID_OBJECT_ID;
- if(VEC[2] >= Float:-0.00535) {
- if(p_SkipNextAB[playerid]) {
- SPEEDx = (((floatsqroot(((p_AirBrkCheck[playerid][newX] - p_AirBrkCheck[playerid][lastX])*(p_AirBrkCheck[playerid][newX] - p_AirBrkCheck[playerid][lastX]))+((p_AirBrkCheck[playerid][newY] - p_AirBrkCheck[playerid][lastY])*(p_AirBrkCheck[playerid][newY] - p_AirBrkCheck[playerid][lastY])))/((diff/1000)+Float:0.0001)))+Float:0.000000000000001);
- SPEEDu = floatsqroot(VEC[0]*VEC[0]+VEC[1]*VEC[1]);
- Checks[0] = ((SPEEDu/SPEEDx)*Float:100.0 < Float:0.00001) && !IsPlayerInRangeOfPoint(playerid, Float:15.0, p_AirBrkCheck[playerid][lastX], p_AirBrkCheck[playerid][lastY],p_AirBrkCheck[playerid][newZ]);
- p_SkipNextAB[playerid] = false;
- }
- else {
- SPEEDx = (((floatsqroot(((p_AirBrkCheck[playerid][newX] - p_AirBrkCheck[playerid][lastX])*(p_AirBrkCheck[playerid][newX] - p_AirBrkCheck[playerid][lastX]))+((p_AirBrkCheck[playerid][newY] - p_AirBrkCheck[playerid][lastY])*(p_AirBrkCheck[playerid][newY] - p_AirBrkCheck[playerid][lastY]))+((p_AirBrkCheck[playerid][newZ] - p_AirBrkCheck[playerid][lastZ])*(p_AirBrkCheck[playerid][newZ] - p_AirBrkCheck[playerid][lastZ])))/((diff/1000)+Float:0.0001)))+Float:0.000000000000001);
- SPEEDu = floatsqroot(VEC[0]*VEC[0]+VEC[1]*VEC[1]+VEC[2]*VEC[2]);
- Checks[0] = ((SPEEDu/SPEEDx)*Float:100.0 < Float:0.00001) && !IsPlayerInRangeOfPoint(playerid, Float:15.0, p_AirBrkCheck[playerid][lastX],p_AirBrkCheck[playerid][lastY],p_AirBrkCheck[playerid][lastZ]);
- }
- }
- else {
- SPEEDx = (((floatsqroot(((p_AirBrkCheck[playerid][newX] - p_AirBrkCheck[playerid][lastX])*(p_AirBrkCheck[playerid][newX] - p_AirBrkCheck[playerid][lastX]))+((p_AirBrkCheck[playerid][newY] - p_AirBrkCheck[playerid][lastY])*(p_AirBrkCheck[playerid][newY] - p_AirBrkCheck[playerid][lastY])))/((diff/1000)+Float:0.0001)))+Float:0.000000000000001);
- SPEEDu = floatsqroot(VEC[0]*VEC[0]+VEC[1]*VEC[1]);
- Checks[0] = ((SPEEDu/SPEEDx)*Float:100.0 < Float:0.00001) && !IsPlayerInRangeOfPoint(playerid, Float:15.0, p_AirBrkCheck[playerid][lastX], p_AirBrkCheck[playerid][lastY], p_AirBrkCheck[playerid][newZ]);
- p_SkipNextAB[playerid] = true;
- }
- Checks[1] = SPEEDx >= Float:15.0 && SPEEDu < Float:0.33000;
- p_AirBrkCheck[playerid][LastMeasured] = GetTickCount();
- p_AirBrkCheck[playerid][lastX] = p_AirBrkCheck[playerid][newX];
- p_AirBrkCheck[playerid][lastY] = p_AirBrkCheck[playerid][newY];
- p_AirBrkCheck[playerid][lastZ] = p_AirBrkCheck[playerid][newZ];
- if((Checks[0] && Checks[2]) || (Checks[1] && Checks[2])) {
- if(Checks[0] && Checks[1]) {
- if(SPEEDx < Float:9000.0) {
- if(SPEEDx < Float:250.0) {
- //AIRBREAK
- #if SAVE_LOG == true
- //Save File
- static
- strins_[128],
- strins_name[MAX_PLAYER_NAME]
- ;
- GetPlayerName(playerid, strins_name, sizeof(strins_name));
- format(strins_, sizeof(strins_), "%s usou airbreak", strins_name);
- CriarLog_Cheats("UsaramAirbreakHack", strins_);
- #endif
- //busted
- CallLocalFunction(#OnPlayerControllingCheat, #ii, playerid, PLAYER_ONBREAK_HACK_1);
- }
- else {
- //CARTELE
- #if SAVE_LOG == true
- //Save File
- static
- strins_[128],
- strins_name[MAX_PLAYER_NAME]
- ;
- GetPlayerName(playerid, strins_name, sizeof(strins_name));
- format(strins_, sizeof(strins_), "%s usou car tele", strins_name);
- CriarLog_Cheats("UsaramTeleCarHack", strins_);
- #endif
- //busted
- CallLocalFunction(#OnPlayerControllingCheat, #ii, playerid, PLAYER_ONBREAKCAR_HACK_1);
- }
- }
- }
- else {
- if(SPEEDx < Float:9000.0) {
- if(SPEEDx < Float:250.0) {
- //AIRBREAK
- #if SAVE_LOG == true
- //Save File
- static
- strins_[128],
- strins_name[MAX_PLAYER_NAME]
- ;
- GetPlayerName(playerid, strins_name, sizeof(strins_name));
- format(strins_, sizeof(strins_), "%s usou airbreak hack", strins_name);
- CriarLog_Cheats("UsaramAirbreakHack", strins_);
- #endif
- //busted
- CallLocalFunction(#OnPlayerControllingCheat, #ii, playerid, PLAYER_ONBREAK_HACK_2);
- }
- else {
- //CARTELE
- #if SAVE_LOG == true
- //Save File
- static
- strins_[128],
- strins_name[MAX_PLAYER_NAME]
- ;
- GetPlayerName(playerid, strins_name, sizeof(strins_name));
- format(strins_, sizeof(strins_), "%s usou car tele", strins_name);
- CriarLog_Cheats("UsaramTeleCarHack", strins_);
- #endif
- //busted
- CallLocalFunction(#OnPlayerControllingCheat, #ii, playerid, PLAYER_ONBREAKCAR_HACK_2);
- }
- }
- }
- }
- break;
- }
- case PLAYER_STATE_DRIVER: {
- GetVehicleVelocity(GetPlayerVehicleID(playerid), VEC[0], VEC[1], VEC[2]);
- GetVehiclePos(GetPlayerVehicleID(playerid), p_AirBrkCheck[playerid][newX], p_AirBrkCheck[playerid][newY], p_AirBrkCheck[playerid][newZ]);
- Checks[2] = GetPlayerSurfingObjectID(playerid) == INVALID_OBJECT_ID;
- if(VEC[2] >= Float:-0.00535) {
- if(p_SkipNextAB[playerid]) {
- SPEEDx = (((floatsqroot(((p_AirBrkCheck[playerid][newX] - p_AirBrkCheck[playerid][lastX])*(p_AirBrkCheck[playerid][newX] - p_AirBrkCheck[playerid][lastX]))+((p_AirBrkCheck[playerid][newY] - p_AirBrkCheck[playerid][lastY])*(p_AirBrkCheck[playerid][newY] - p_AirBrkCheck[playerid][lastY])))/((diff/1000)+Float:0.0001)))+Float:0.000000000000001);
- SPEEDu = floatsqroot(VEC[0]*VEC[0]+VEC[1]*VEC[1]);
- Checks[0] = ((SPEEDu/SPEEDx)*Float:100.0 < Float:0.00001) && !IsPlayerInRangeOfPoint(playerid, Float:20.0, p_AirBrkCheck[playerid][lastX], p_AirBrkCheck[playerid][lastY], p_AirBrkCheck[playerid][newZ]);
- p_SkipNextAB[playerid] = false;
- }
- else {
- SPEEDx = (((floatsqroot(((p_AirBrkCheck[playerid][newX] - p_AirBrkCheck[playerid][lastX])*(p_AirBrkCheck[playerid][newX] - p_AirBrkCheck[playerid][lastX]))+((p_AirBrkCheck[playerid][newY] - p_AirBrkCheck[playerid][lastY])*(p_AirBrkCheck[playerid][newY] - p_AirBrkCheck[playerid][lastY]))+((p_AirBrkCheck[playerid][newZ] - p_AirBrkCheck[playerid][lastZ])*(p_AirBrkCheck[playerid][newZ] - p_AirBrkCheck[playerid][lastZ])))/((diff/1000)+Float:0.0001)))+Float:0.000000000000001);
- SPEEDu = floatsqroot(VEC[0]*VEC[0]+VEC[1]*VEC[1]+VEC[2]*VEC[2]);
- Checks[0] = ((SPEEDu/SPEEDx)*Float:100.0 < Float:0.00001) && !IsPlayerInRangeOfPoint(playerid, Float:20.0, p_AirBrkCheck[playerid][lastX], p_AirBrkCheck[playerid][lastY], p_AirBrkCheck[playerid][lastZ]);
- }
- }
- else {
- SPEEDx = (((floatsqroot(((p_AirBrkCheck[playerid][newX] - p_AirBrkCheck[playerid][lastX])*(p_AirBrkCheck[playerid][newX] - p_AirBrkCheck[playerid][lastX]))+((p_AirBrkCheck[playerid][newY] - p_AirBrkCheck[playerid][lastY])*(p_AirBrkCheck[playerid][newY] - p_AirBrkCheck[playerid][lastY])))/((diff/1000)+Float:0.0001)))+Float:0.000000000000001);
- SPEEDu = floatsqroot(VEC[0]*VEC[0]+VEC[1]*VEC[1]);
- Checks[0] = ((SPEEDu/SPEEDx)*Float:100.0 < Float:0.001) && !IsPlayerInRangeOfPoint(playerid, Float:20.0, p_AirBrkCheck[playerid][lastX], p_AirBrkCheck[playerid][lastY], p_AirBrkCheck[playerid][newZ]);
- p_SkipNextAB[playerid] = true;
- }
- Checks[1] = SPEEDx >= Float:75.0 && SPEEDu < Float:0.40000;
- p_AirBrkCheck[playerid][LastMeasured] = GetTickCount();
- p_AirBrkCheck[playerid][lastX] = p_AirBrkCheck[playerid][newX];
- p_AirBrkCheck[playerid][lastY] = p_AirBrkCheck[playerid][newY];
- p_AirBrkCheck[playerid][lastZ] = p_AirBrkCheck[playerid][newZ];
- if((Checks[0] && Checks[2]) || (Checks[1] && Checks[2])) {
- if(Checks[0] && Checks[1]) {
- if(SPEEDx < Float:9000.0) {
- if(SPEEDx < Float:250.0) {
- //CARAIRBREAK
- #if SAVE_LOG == true
- //Save File
- static
- strins_[128],
- strins_name[MAX_PLAYER_NAME]
- ;
- GetPlayerName(playerid, strins_name, sizeof(strins_name));
- format(strins_, sizeof(strins_), "%s usou airbreak hack", strins_name);
- CriarLog_Cheats("UsaramAirbreakHack", strins_);
- #endif
- //busted
- CallLocalFunction(#OnPlayerControllingCheat, #ii, playerid, PLAYER_ONBREAK_HACK_3);
- }
- else {
- //CARTELE
- #if SAVE_LOG == true
- //Save File
- static
- strins_[128],
- strins_name[MAX_PLAYER_NAME]
- ;
- GetPlayerName(playerid, strins_name, sizeof(strins_name));
- format(strins_, sizeof(strins_), "%s usou car tele", strins_name);
- CriarLog_Cheats("UsaramTeleCarHack", strins_);
- #endif
- //busted
- CallLocalFunction(#OnPlayerControllingCheat, #ii, playerid, PLAYER_ONBREAKCAR_HACK_3);
- }
- }
- }
- else {
- if(SPEEDx < Float:9000.0) {
- if(SPEEDx < Float:250.0) {
- //AIRBREAK
- #if SAVE_LOG == true
- //Save File
- static
- strins_[128],
- strins_name[MAX_PLAYER_NAME]
- ;
- GetPlayerName(playerid, strins_name, sizeof(strins_name));
- format(strins_, sizeof(strins_), "%s usou airbreak hack", strins_name);
- CriarLog_Cheats("UsaramAirbreakHack", strins_);
- #endif
- //busted
- CallLocalFunction(#OnPlayerControllingCheat, #ii, playerid, PLAYER_ONBREAK_HACK_4);
- }
- else {
- //CARTELE
- #if SAVE_LOG == true
- //Save File
- static
- strins_[128],
- strins_name[MAX_PLAYER_NAME]
- ;
- GetPlayerName(playerid, strins_name, sizeof(strins_name));
- format(strins_, sizeof(strins_), "%s usou car tele", strins_name);
- CriarLog_Cheats("UsaramTeleCarHack", strins_);
- #endif
- //busted
- CallLocalFunction(#OnPlayerControllingCheat, #ii, playerid, PLAYER_ONBREAKCAR_HACK_4);
- }
- }
- }
- break;
- }
- break;
- }
- }
- }
- return 1;
- }
- //stocks
- stock _isPlayerUsingSwimAnimEx(playerid) { // By Synchro
- if(IsPlayerInAnyVehicle(playerid) || GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return false;
- static
- _animlibEx[32],
- _animnameEx[32]
- ;
- GetAnimationName(GetPlayerAnimationIndex(playerid), _animlibEx, 32, _animnameEx, 32);
- if(!strcmp(_animlibEx, "SWIM", true) && !strcmp(_animnameEx, "SWIM_GLIDE", true)) return true;
- else if(!strcmp(_animlibEx, "SWIM", true) && !strcmp(_animnameEx, "SWIM_BREAST", true)) return true;
- else if(!strcmp(_animlibEx, "SWIM", true) && !strcmp(_animnameEx, "SWIM_CRAWL", true)) return true;
- else if(!strcmp(_animlibEx, "SWIM", true) && !strcmp(_animnameEx, "SWIM_DIVE_UNDER", true)) return true;
- else if(!strcmp(_animlibEx, "SWIM", true) && !strcmp(_animnameEx, "SWIM_DIVE_GLIDE", true)) return true;
- else if(!strcmp(_animlibEx, "SWIM", true) && !strcmp(_animnameEx, "SWIM_UNDER", true)) return true;
- else if(!strcmp(_animlibEx, "SWIM", true) && !strcmp(_animnameEx, "SWIM_TREAD", true)) return true;
- return false;
- }
- stock _isPlayerInWaterEx(playerid) { // Junior
- static
- Float:POS[3]
- ;
- GetPlayerPos(playerid, POS[0], POS[1], POS[2]);
- if((POS[0] >= -1408.0629 && POS[1] >= 2021.0587 && POS[0] <= -460.9319 && POS[1] <= 2861.4893) ||
- (POS[0] >= 1269.5886 && POS[1] >= -810.4507 && POS[0] <= 1288.8916 && POS[1] <= -800.5959) ||
- (POS[0] >= 1086.6010 && POS[1] >= -683.6998 && POS[0] <= 1103.0225 && POS[1] <= -662.1832) ||
- (POS[0] >= 169.6879 && POS[1] >= -1392.6630 && POS[0] <= 281.5444 && POS[1] <= -1168.9749) ||
- (POS[0] >= -828.3018 && POS[1] >= -2107.1487 && POS[0] <= -443.5032 && POS[1] <= -1855.6273) ||
- (POS[0] >= 1198.9982 && POS[1] >= -2407.0581 && POS[0] <= 1275.7397 && POS[1] <= -2341.6262) ||
- (POS[0] >= 2293.1467 && POS[1] >= -1432.5869 && POS[0] <= 2331.7388 && POS[1] <= -1397.6476) ||
- (POS[0] >= 1915.3196 && POS[1] >= -1236.2382 && POS[0] <= 2016.6565 && POS[1] <= -1167.9290) ||
- (POS[0] >= -2747.1692 && POS[1] >= -510.1152 && POS[0] <= -2663.2468 && POS[1] <= -411.4905) ||
- (POS[0] >= 1838.8041 && POS[1] >= 1463.2024 && POS[0] <= 2035.4167 && POS[1] <= 1703.0480) ||
- (POS[0] >= 2049.6646 && POS[1] >= 1843.3029 && POS[0] <= 2119.9021 && POS[1] <= 1983.5464) ||
- (POS[0] >= 2094.9255 && POS[1] >= 1085.2852 && POS[0] <= 2179.1790 && POS[1] <= 1183.0610) ||
- (POS[0] >= 2545.3718 && POS[1] >= 2347.7112 && POS[0] <= 2593.6794 && POS[1] <= 2403.8040)) return true;
- return false;
- }
- stock CriarLog_Cheats(_LogNameEx[], _TextEx[]) {
- #if SAVE_LOG == true
- static
- File:_entry,
- _other[128],
- _strlog[128],
- _year,
- _month,
- _day,
- _hour,
- _minute,
- _second
- ;
- getdate(_year, _month, _day);
- gettime(_hour, _minute, _second);
- format(_other, sizeof(_other), INVALID_FILE, _LogNameEx);
- _entry = fopen(_other, io_append);
- if(fexist(_other)) {
- if(flength(_entry) > 262144) { //-- Arquivo grande..
- fclose(_entry);
- static
- _arqStr[128]
- ;
- format(_arqStr, sizeof(_arqStr), "%s_%i-%i-%i_%i.%i.%i.txt", _other, _year, _month, _day, _hour, _minute, _second);
- _frenameEx(_other, _arqStr);
- _entry = fopen(_other, io_append);
- }
- }
- format(_strlog, sizeof(_strlog), "[%d.%d.%d %d:%d:%d] %s\r\n", _day, _month, _year, _hour, _minute, _second, _TextEx);
- fwrite(_entry, _strlog);
- fclose(_entry);
- #endif
- return true;
- }
- stock _frenameEx(_oldnameEx[], _newnameEx[]) {
- if(!fexist(_oldnameEx)) return false;
- fremove(_newnameEx);
- if(!_fcopyEx(_oldnameEx, _newnameEx)) return false;
- fremove(_oldnameEx);
- return true;
- }
- stock _fcopyEx(_oldnameEx[], _newnameEx[]) {
- static
- File:_OHND,
- File:_NHND
- ;
- if(!fexist(_oldnameEx)) return false;
- _OHND = fopen(_oldnameEx, io_read);
- _NHND = fopen(_newnameEx, io_write);
- static
- _BUF[1]
- ;
- static
- i
- ;
- for(i = flength(_OHND); i > 0; i--) {
- fputchar(_NHND, fgetchar(_OHND, _BUF[0], false), false);
- }
- fclose(_OHND);
- fclose(_NHND);
- return true;
- }
- stock _GivePlayerMoneyEx(playerid, amount) {
- ResetPlayerMoney(playerid);
- SetPVarInt(playerid, #registerMoney, GetPVarInt(playerid, #registerMoney) + amount);
- if(GetPVarInt(playerid, #registerMoney) > GetPVarInt(playerid, #registermaxMoney)) SetPVarInt(playerid, #registermaxMoney, GetPVarInt(playerid, #registerMoney));
- return GivePlayerMoney(playerid, GetPVarInt(playerid, #registerMoney));
- }
- #if defined _ALS_GivePlayerMoney
- #undef GivePlayerMoney
- #else
- #define _ALS_GivePlayerMoney
- #endif
- #define GivePlayerMoney _GivePlayerMoneyEx
- stock _ResetPlayerMoneyEx(playerid) {
- return DeletePVar(playerid, #registerMoney), DeletePVar(playerid, #registermaxMoney), ResetPlayerMoney(playerid);
- }
- #if defined _ALS_ResetPlayerMoney
- #undef ResetPlayerMoney
- #else
- #define _ALS_ResetPlayerMoney
- #endif
- #define ResetPlayerMoney _ResetPlayerMoneyEx
- stock _SetPlayerScoreEx(playerid, score) {
- SetPVarInt(playerid, #registerScore, score);
- if(GetPVarInt(playerid, #registerScore) > GetPVarInt(playerid, #registermaxScore)) SetPVarInt(playerid, #registermaxScore, GetPVarInt(playerid, #registerScore));
- return SetPlayerScore(playerid, GetPVarInt(playerid, #registerScore));
- }
- #if defined _ALS_SetPlayerScore
- #undef SetPlayerScore
- #else
- #define _ALS_SetPlayerScore
- #endif
- #define SetPlayerScore _SetPlayerScoreEx
- stock _PutPlayerInVehicleEx(playerid, vehicleid, seatid) {
- if(playerid < 0 || playerid >= MAX_PLAYERS) return 0;
- if(vehicleid < 0 || vehicleid >= MAX_VEHICLES) return 0;
- static
- Float:POSs[3]
- ;
- GetVehiclePos(vehicleid, POSs[0], POSs[1], POSs[2]);
- SetPlayerPos(playerid, POSs[0], POSs[1], POSs[2]);
- p_VehicleEnterTime[playerid] -= (g_MassTpDelay+1);
- p_AirBrkCheck[playerid][newX] = POSs[0];
- p_AirBrkCheck[playerid][newY] = POSs[1];
- p_AirBrkCheck[playerid][newZ] = POSs[2];
- p_AirBrkCheck[playerid][lastX] = p_AirBrkCheck[playerid][newX] + Float:0.2;
- p_AirBrkCheck[playerid][lastY] = p_AirBrkCheck[playerid][newY] + Float:0.2;
- p_AirBrkCheck[playerid][lastZ] = p_AirBrkCheck[playerid][newZ] + Float:0.2;
- p_IsInVehicle[playerid] = vehicleid;
- v_PlayerInVehicle[p_IsInVehicle[playerid]] = playerid;
- return PutPlayerInVehicle(playerid, vehicleid, seatid);
- }
- #if defined _ALS_PutPlayerInVehicle
- #undef PutPlayerInVehicle
- #else
- #define _ALS_PutPlayerInVehicle
- #endif
- #define PutPlayerInVehicle _PutPlayerInVehicleEx
- stock _SetPlayerPosEx(playerid, Float:x, Float:y, Float:z) {
- p_AirBrkCheck[playerid][newX] = x;
- p_AirBrkCheck[playerid][newY] = y;
- p_AirBrkCheck[playerid][newZ] = z;
- p_AirBrkCheck[playerid][lastX] = p_AirBrkCheck[playerid][newX] + Float:0.2;
- p_AirBrkCheck[playerid][lastY] = p_AirBrkCheck[playerid][newY] + Float:0.2;
- p_AirBrkCheck[playerid][lastZ] = p_AirBrkCheck[playerid][newZ] + Float:0.2;
- return SetPlayerPos(playerid, x, y, z);
- }
- #if defined _ALS_SetPlayerPos
- #undef SetPlayerPos
- #else
- #define _ALS_SetPlayerPos
- #endif
- #define SetPlayerPos _SetPlayerPosEx
- stock _SetPlayerPosFindZEx(playerid, Float:x, Float:y, Float:z) {
- p_AirBrkCheck[playerid][newX] = x;
- p_AirBrkCheck[playerid][newY] = y;
- p_AirBrkCheck[playerid][newZ] = z;
- p_AirBrkCheck[playerid][lastX] = p_AirBrkCheck[playerid][newX] + Float:0.2;
- p_AirBrkCheck[playerid][lastY] = p_AirBrkCheck[playerid][newY] + Float:0.2;
- p_AirBrkCheck[playerid][lastZ] = p_AirBrkCheck[playerid][newZ] + Float:0.2;
- return SetPlayerPosFindZ(playerid, x, y, z);
- }
- #if defined _ALS_SetPlayerPosFindZ
- #undef SetPlayerPosFindZ
- #else
- #define _ALS_SetPlayerPosFindZ
- #endif
- #define SetPlayerPosFindZ _SetPlayerPosFindZEx
- stock _SetVehiclePosEx(vehicleid, Float:x, Float:y, Float:z) {
- if(v_PlayerInVehicle[vehicleid] != (-1)) {
- p_AirBrkCheck[v_PlayerInVehicle[vehicleid]][newX] = x;
- p_AirBrkCheck[v_PlayerInVehicle[vehicleid]][newY] = y;
- p_AirBrkCheck[v_PlayerInVehicle[vehicleid]][newZ] = z;
- p_AirBrkCheck[v_PlayerInVehicle[vehicleid]][lastX] = p_AirBrkCheck[v_PlayerInVehicle[vehicleid]][newX] + Float:0.2;
- p_AirBrkCheck[v_PlayerInVehicle[vehicleid]][lastY] = p_AirBrkCheck[v_PlayerInVehicle[vehicleid]][newY] + Float:0.2;
- p_AirBrkCheck[v_PlayerInVehicle[vehicleid]][lastZ] = p_AirBrkCheck[v_PlayerInVehicle[vehicleid]][newZ] + Float:0.2;
- }
- return SetVehiclePos(vehicleid, x, y, z);
- }
- #if defined _ALS_SetVehiclePos
- #undef SetVehiclePos
- #else
- #define _ALS_SetVehiclePos
- #endif
- #define SetVehiclePos _SetVehiclePosEx
- stock _GivePlayerWeaponEx(playerid, weaponid, ammo) {
- static
- strins_weap[13]
- ;
- format(strins_weap, sizeof(strins_weap), "weap%d", _GetWeaponSlotEx(weaponid));
- SetPVarInt(playerid, strins_weap, weaponid);
- return GivePlayerWeapon(playerid, weaponid, ammo);
- }
- #if defined _ALS_GivePlayerWeapon
- #undef GivePlayerWeapon
- #else
- #define _ALS_GivePlayerWeapon
- #endif
- #define GivePlayerWeapon _GivePlayerWeaponEx
- stock _ResetPlayerWeaponEx(playerid) {
- static
- str_weap[13]
- ;
- for(new x = 0; x < 13; x++) {
- format(str_weap, sizeof(str_weap), "weap%d", x);
- DeletePVar(playerid, str_weap);
- }
- return ResetPlayerWeapons(playerid);
- }
- #if defined _ALS_ResetPlayerWeapons
- #undef ResetPlayerWeapons
- #else
- #define _ALS_ResetPlayerWeapons
- #endif
- #define ResetPlayerWeapons _ResetPlayerWeaponEx
- stock _GetWeaponSlotEx(weaponid) { // By Hiddos
- static
- _slotEx
- ;
- switch(weaponid) {
- case 0, 1: _slotEx = 0;
- case 2 .. 9: _slotEx = 1;
- case 10 .. 15: _slotEx = 10;
- case 16 .. 18, 39: _slotEx = 8;
- case 22 .. 24: _slotEx = 2;
- case 25 .. 27: _slotEx = 3;
- case 28, 29, 32: _slotEx = 4;
- case 30, 31: _slotEx = 5;
- case 33, 34: _slotEx = 6;
- case 35 .. 38: _slotEx = 7;
- case 40: _slotEx = 12;
- case 41 .. 43: _slotEx = 9;
- case 44 .. 46: _slotEx = 11;
- }
- return _slotEx;
- }
- stock _registerIPEx(playerid) {
- static
- getip[16]
- ;
- GetPlayerIp(playerid, getip, sizeof(getip));
- return getip;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement