12.05.2014, 02:24
Everyone can go in every faction car, but i don't know whats worng, can someone help me please, the only car you can't enter is the licenses car
+rep if you helped me!
+rep if you helped me!
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(!ispassenger)
{
if(IsDMVCar(vehicleid))
{
if(!LicenseTest[playerid])
{
SendClientMessage(playerid, COLOR_ORANGE, "You are not taking a drivers license test.");
ClearAnimations(playerid,true);
}
else
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "* GPS: Finish the test by driving through all of the checkpoints on your GPS.");
SetPlayerCheckpoint(playerid,980.1932,-1407.9902,13.0956,5);
SendClientMessage(playerid, COLOR_RED, "If you exit the car your test will be failed and it will have to be re-done.");
}
}
if(IsDLCar(vehicleid))
{
ClearAnimations(playerid,true);
}
else if(IsFamVehicle(vehicleid) && Fam[vehicleid] != PlayerInfo[playerid][pFam] && !IsACop(playerid))
{
SendClientMessage(playerid, COLOR_ORANGE, " You can't start the engine as it belongs to a family.");
ClearAnimations(playerid,true);
print("Family cars loaded successfully.");
}
else if(IsLeoVehicle(vehicleid) && PlayerInfo[playerid][pFac] != 1)
{
SendClientMessage(playerid, COLOR_ORANGE, " You can't start the engine as it belongs to the LSPD.");
ClearAnimations(playerid,true);
print("Police Cars loaded successfully.");
}
else if(IsLSFMDVehicle(vehicleid) && PlayerInfo[playerid][pFac] != 5)
{
SendClientMessage(playerid, COLOR_ORANGE, " You can't start the engine as it belongs to the LSFMD.");
ClearAnimations(playerid,true);
print("LSFMD cars loaded successfully.");
}
else if(IsNewsVehicle(vehicleid) && PlayerInfo[playerid][pFac] != 4)
{
SendClientMessage(playerid, COLOR_ORANGE, " You can't start the engine as it belongs to the News Agency.");
ClearAnimations(playerid,true);
print("News cars loaded successfully.");
}
else if(IsFBIVehicle(vehicleid) && PlayerInfo[playerid][pFac] != 6)
{
SendClientMessage(playerid, COLOR_ORANGE, " You can't start the engine as it belongs to the FBI.");
ClearAnimations(playerid,true);
print("FBI cars loaded successfully.");
}
else if(IsNGVehicle(vehicleid) && PlayerInfo[playerid][pFac] != 7)
{
SendClientMessage(playerid, COLOR_ORANGE, " You can't start the engine as it belongs to the NG.");
ClearAnimations(playerid,true);
print("NG cars loaded successfully.");
}
else if(IsTruckerVehicle(vehicleid) && PlayerInfo[playerid][pJob] != JOB_TRUCKER)
{
SendClientMessage(playerid, COLOR_ORANGE, " You can't start the engine as it belongs to the Truckers.");
ClearAnimations(playerid,true);
print("Trucks cars loaded successfully.");
}
else if(IsGovVehicle(vehicleid) && PlayerInfo[playerid][pFac] != 2)
{
SendClientMessage(playerid, COLOR_ORANGE, " You can't start the engine as it belongs to the GOV.");
ClearAnimations(playerid,true);
print("Gov cars loaded successfully.");
}
}
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
if(LicenseTest[playerid])
{
DisablePlayerCheckpoint(playerid);
LicenseTest[playerid] = 0;
CP[playerid] = 0;
SetVehicleToRespawn(GetPlayerVehicleID(playerid));
SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Driving Center: You have left your car, therefore your test has been failed.");
}
if(PlayerInfo[playerid][pFac] == 1 && PlayerInfo[playerid][pFac] == 7 && PlayerInfo[playerid][pFac] == 6)
{
LastCar[playerid] = vehicleid;
}
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_PASSENGER)
{
SetPlayerArmedWeapon(playerid,0);
}
if(newstate == PLAYER_STATE_PASSENGER)
{
if(newstate == PLAYER_STATE_PASSENGER)
{
new gun,tmp;
GetPlayerWeaponData(playerid,4,gun,tmp);
#pragma unused tmp
if(gun)SetPlayerArmedWeapon(playerid,gun);
else SetPlayerArmedWeapon(playerid,0);
}
}
if(newstate == PLAYER_STATE_DRIVER && oldstate != PLAYER_STATE_DRIVER)
{
new vehicleid = GetPlayerVehicleID(playerid);
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
if(!engine) SendClientMessage(playerid, COLOR_WHITE, "You can start or stop the vehicle's engine using {FF6347}/engine{FFFFFF}.");
//if(!engine) GameTextForPlayer(playerid, "~w~/engine to turn on/off the vehicle engine.", 3500, 3);
if(!PlayerInfo[playerid][pCarLic]) SendClientMessage(playerid, COLOR_LIGHTRED, " You don't have a drivers license, beware of cops.");
//if(IsATowTruck(vehicleid)) SendClientMessage(playerid, COLOR_WHITE, "You can tow a vehicle using {FF6347}/tow{FFFFFF}.");
}
return 1;
}