Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define PUB->%0(%1) public %0(%1)
- #define STR->%0(%1) stock %0(%1)
- #define FUNC->%0(%1) forward %0(%1); public %0(%1)
- #define FORM->%0(%1) format(%0, sizeof(%0), %1)
- #define FRE->%0 TogglePlayerControllable(%0, false)
- #define UNFRE->%0 TogglePlayerControllable(%0, true)
- #define TIM->%0(%1, %2, %3, %4) SetTimerEx(%0, %1, %2, %3, %4)
- #define PLAYERNAME->%0(%1) GetPlayerName(%1, %0, sizeof(%0))
- PUB->OnPlayerConnect(playerid)
- {
- TIM->OnSpeedHack(1000, false, "i", playerid);
- return 1;
- }
- FUNC->OnSpeedHack(playerid)
- {
- if(GetPlayerSpeed(playerid) > 150)
- {
- static plrName[MAX_PLAYER_NAME+2], output[200];
- PLAYERNAME->plrName;
- FORM->Output("%s detected using speedhack at (%d km/u)", plrName, GetPlayerSpeed(playerid));
- SendClientMessage(playerid, -1, Output);
- Kick(playerid); //or Ban(playerid);
- return 1;
- }
- return 0;
- }
- STR->GetPlayerSpeed(playerid,bool:kmh)
- {
- new Float:Vx,Float:Vy,Float:Vz,Float:rtn;
- if(IsPlayerInAnyVehicle(playerid)) GetVehicleVelocity(GetPlayerVehicleID(playerid),Vx,Vy,Vz); else GetPlayerVelocity(playerid,Vx,Vy,Vz);
- rtn = floatsqroot(floatabs(floatpower(Vx + Vy + Vz,2)));
- return kmh?floatround(rtn * 100 * 1.61):floatround(rtn * 100);
- }
Add Comment
Please, Sign In to add comment