if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) { new Float:speed; speed = GetPlayerSpeed(playerid, false); if(speed > 280) { new string[100]; new name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name)); format(string, 100, "%s was auto-banned for SpeedHack.", name); SendClientMessageToAll(COLOR_RED, string); BanLog(string); Ban(playerid); new str[100]; format(str,sizeof str,"0,4s was auto-banned for SpeedHack", name); IRC_GroupSay(gGroupID, IRC_CHANNEL, str); } if(!IsPlayerInPlane(playerid)) { speed = GetPlayerSpeed(playerid, true); if(speed > 310) { new string[100]; new name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name)); format(string, 100, "%s was auto-banned for SpeedHack.", name); SendClientMessageToAll(COLOR_RED, string); Ban(playerid); BanLog(string); new str[100]; format(str,sizeof str,"0,4s was auto-banned for SpeedHack", name); IRC_GroupSay(gGroupID, IRC_CHANNEL, str); } } }
stock 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); } stock IsPlayerInPlane(playerid) { if(IsPlayerInAnyVehicle(playerid)) { switch(GetVehicleModel(GetPlayerVehicleID(playerid))) { case 593,592,577,563,553,548,520,519,513,512,511, 497,488,487,476,469,460,447,425,417,493,484,453: return 1; default: return 0; } } return 0; }
This ban only who reach a specific speedlimit,how the script can ban a player (offline) that has reached the specific speedlimit?lol.
|
Ban(playerid);
SendClientMessage(playerid,0xFFFFFFF,"Hello world");
SetTimer("Timer1",1000,0);
SendClientMessage(playerid,0xFFFFFFF,"Hello world");
SetTimer("Timer1",1000,0);
Ban(playerid);
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
new Float:speed;
speed = GetPlayerSpeed(playerid, false);
if(speed > 280)
{
new string[100];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(string, 100, "%s was auto-banned for SpeedHack.", name);
SendClientMessageToAll(COLOR_RED, string);
BanLog(string);
Ban(playerid);
new str[100];
format(str,sizeof str,"0,4s was auto-banned for SpeedHack", name);
IRC_GroupSay(gGroupID, IRC_CHANNEL, str);
}
if(!IsPlayerInPlane(playerid))
{
speed = GetPlayerSpeed(playerid, true);
if(speed > 310)
{
new string[100];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(string, 100, "%s was auto-banned for SpeedHack.", name);
SendClientMessageToAll(COLOR_RED, string);
Ban(playerid);
BanLog(string);
new str[100];
format(str,sizeof str,"0,4s was auto-banned for SpeedHack", name);
IRC_GroupSay(gGroupID, IRC_CHANNEL, str);
}
return 1;
}
}