Whats wrong with it? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Whats wrong with it? (
/showthread.php?tid=558901)
Whats wrong with it? -
MBilal - 19.01.2015
Код:
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
new veh2 = GetPlayerVehicleID(playerid);// get the vehicle id
new veh1 = GetVehicleModel(veh2);// get the vehicle model
if(veh1 != 460 || veh1 != 520 ||veh1 != 519 ||veh1 != 553 ||veh1 != 577 ||veh1 != 592 ||veh1 != 593 ||veh1 != 513 ||veh1 !=512 ||veh1 !=511 ||veh1 != 476 )
{
if(GetVehicleSpeed(GetPlayerVehicleID(playerid)) > 250){
SendClientMessage(playerid, COLOR_YELLOW, "You have been banned from the server. Reason: Sobiet Speed Hack");
format(Jstring, 128, "Bot : %s has been Banned from the server. Reason: Speed Hack", GetName(playerid));
SendClientMessageToAll(COLOR_KRED, Jstring);
SetTimerEx("BP",10,false,"d", playerid);
return 1;
}}
}
stock GetVehicleSpeed(vehicleid)
{ new Float:xPos[3]; GetVehicleVelocity(vehicleid, xPos[0], xPos[1], xPos[2]);
return floatround(floatsqroot(xPos[0] * xPos[0] + xPos[1] * xPos[1] + xPos[2] * xPos[2]) * 170.00); }
I see some players got Banned using Rustlers...and some other vehicles..
Re: Whats wrong with it? -
Ironboy - 19.01.2015
pawn Код:
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
new veh2 = GetPlayerVehicleID(playerid);// get the vehicle id
new veh1 = GetVehicleModel(veh2);// get the vehicle model
if(GetVehicleSpeed(GetPlayerVehicleID(playerid)) > 250)
{
if(veh1 != 460 || veh1 != 520 ||veh1 != 519 ||veh1 != 553 ||veh1 != 577 ||veh1 != 592 ||veh1 != 593 ||veh1 != 513 ||veh1 !=512 ||veh1 !=511 ||veh1 != 476 )
{
SendClientMessage(playerid, COLOR_YELLOW, "You have been banned from the server. Reason: Sobiet Speed Hack");
format(Jstring, 128, "Bot : %s has been Banned from the server. Reason: Speed Hack", GetName(playerid));
SendClientMessageToAll(COLOR_KRED, Jstring);
SetTimerEx("BP",10,false,"d", playerid);
}
}
}
Re: Whats wrong with it? -
MBilal - 19.01.2015
I tried that code ..I used Rustler and i got banned..
Re: Whats wrong with it? -
Vince - 19.01.2015
Your if-statement is logically wrong. You need to use AND, not OR. However, my personal preference is the NOR construct, e.g.
pawn Код:
if(!(veh1 == 460 || veh1 == 519 || veh1 == 520 /*etc*/))
Re: Whats wrong with it? -
MBilal - 19.01.2015
Код:
I changed the code a bit.
new FLYVehicles[] = {
469, 447, 463 ,488 , 487 , 417, 425 ,497 , 460 , 520 , 519 , 553 , 577 ,592 ,593 , 513 ,512 ,511 ,476 , 548
};
stock IsVehicleFLYVehicle(vehicleid)
{
for(new v; v < 20; v++)
{
if(GetVehicleModel(vehicleid) == FLYVehicles[v]) return 1;
}
return 0;
}
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
if(GetVehicleSpeed(GetPlayerVehicleID(playerid)) > 250 && !IsVehicleFLYVehicle(GetPlayerVehicleID(playerid))){
SendClientMessage(playerid, COLOR_YELLOW, "You have been banned from the server. Reason: Sobiet Speed Hack");
format(Jstring, 128, "Bot : %s has been Banned from the server. Reason: Speed Hack", GetName(playerid));
SendClientMessageToAll(COLOR_KRED, Jstring);
SetTimerEx("BP",10,false,"d", playerid);
return 1;
}}
I tried now this with rustler not get banned and high speed is it .! and i tried other vehicles like patriot they got banned with speed hack and this Work Fine! thanks For Repy Rep++