PDA

View Full Version : Whats wrong with it?


MBilal
19/01/2015, 07:31 PM
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..

Ironboy
19/01/2015, 07:40 PM
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);
}
}

}

MBilal
19/01/2015, 07:56 PM
I tried that code ..I used Rustler and i got banned..

Vince
19/01/2015, 08:03 PM
Your if-statement is logically wrong. You need to use AND, not OR. However, my personal preference is the NOR construct, e.g.

if(!(veh1 == 460 || veh1 == 519 || veh1 == 520 /*etc*/))

MBilal
19/01/2015, 08:16 PM
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++