30.04.2014, 13:50
When I put this script on my gamemode I can drive any vehicle. Also the Factions cars. For example I am a COP but can to drive the YAKUZA cars. Why?
pawn Код:
if (newkeys & KEY_YES)
{
if(GetPlayerState(playerid) == 2)
{
new vehicle = GetPlayerVehicleID(playerid); //This part here is defining the vehicle ID that the player is currently in.
new engine, lights, alarm, doors, bonnet, boot, objective; //This is defining the vehicles current items.
GetVehicleParamsEx(vehicle, engine, lights, alarm, doors, bonnet, boot, objective);//This is checking the vehicle's engine/lights/alarm/doors/bonnet/boot/objective status.
if(Lights[vehicle] == 0) //This is checking if the engine of the vehicle, is turned off or not.
{
Lights[vehicle] = 1; //This is setting the global variable that you created at the beginning.
SetVehicleParamsEx(vehicle, engine, 1, alarm, doors, bonnet, boot, 0); //This is setting the vehicles engine to be on.
GameTextForPlayer(playerid, "~g~LIGHTS ON...", 1000, 6);
}
else
{
Lights[vehicle] = 0; //This is setting the global variable that you created at the beginning.
SetVehicleParamsEx(vehicle, engine, 0, alarm, doors, bonnet, boot, 0); //This is setting the vehicles engine to be on.
GameTextForPlayer(playerid, "~r~LIGHTS OFF...", 1000, 6);
}
}
}