new DMVCar[5]; new MinerCar[3];
// Working one stock IsDMVCar(vehicleid) { for(new i=0; i<5; i++) { if(vehicleid == DMVCar[i]) return 1; } return 0; } // Not working one stock IsMinerVehicle(vehicleid) { for(new i=0; i<10; i++) { if(vehicleid == MinerCar[i]) return 1; } return 0; }
DMVCar[0] = CreateVehicle(445,2056.0117,-1904.0990,13.4219,180.0940,50,92,300); DMVCar[1] = CreateVehicle(445,2062.4028,-1904.3759,13.4219,180.5574,50,92,300); DMVCar[2] = CreateVehicle(445,2062.1218,-1919.2986,13.4219,359.8005,50,92,300); MinerCar[0] = CreateVehicle(486,678.7999900,907.2000100,-40.1000000,102.7540000,1,1,0); //dozer[playerid] MinerCar[1] = CreateVehicle(486,680.0000000,901.2999900,-39.8000000,99.9550000,1,1,0); //dozer[playerid] MinerCar[2] = CreateVehicle(486,681.2000100,894.7000100,-39.6000000,104.4240000,1,1,0); //dozer[playerid]
if(IsDMVCar(vehicleid)) { if(!LicenseTest[playerid]) SendClientMessage(playerid, COLOR_ORANGE, "You are not taking a drivers license test."); else { SendClientMessage(playerid, COLOR_LIGHTBLUE, "* GPS: Finish the test by driving through all of the checkpoints on your GPS."); SetPlayerCheckpoint(playerid, 2052.0376,-1930.2965,13.2517, 5); SendClientMessage(playerid, COLOR_RED, "If you exit the car your test will be failed and it will have to be re-done."); return 1; } } else if(IsFamVehicle(vehicleid) && Fam[vehicleid] != PlayerInfo[playerid][pFam] && !IsACop(vehicleid) && !IsADOC(vehicleid) && !IsASAAF(vehicleid) && !IsSASD(vehicleid)) SendClientMessage(playerid, COLOR_GREY, " You can't get in this car as it belongs to a family."); else if(IsLeoVehicle(vehicleid) && PlayerInfo[playerid][pFac] != 1) SendClientMessage(playerid, COLOR_GREY, " You can't get in this car as it belongs to the LSPD."); else if(IsLSFMDVehicle(vehicleid) && PlayerInfo[playerid][pFac] != 5) SendClientMessage(playerid, COLOR_GREY, " You can't get in this car as it belongs to the LSFMD."); else if(IsNewsVehicle(vehicleid) && PlayerInfo[playerid][pFac] != 4) SendClientMessage(playerid, COLOR_GREY, " You can't get in this car as it belongs to the News Agency."); else if(IsFBIVehicle(vehicleid) && PlayerInfo[playerid][pFac] != 6) SendClientMessage(playerid, COLOR_GREY, " You can't get in this car as it belongs to the FBI."); else if(IsNGVehicle(vehicleid) && PlayerInfo[playerid][pFac] != 7) SendClientMessage(playerid, COLOR_GREY, " You can't get in this car as it belongs to the NG."); else if(IsRETOVehicle(vehicleid) && PlayerInfo[playerid][pFac] != 9) SendClientMessage(playerid, COLOR_GREY, " You can't get in this car as it belongs to Rebel's Towing"); else if(IsTaxiVehicle(vehicleid) && PlayerInfo[playerid][pFac] != 10) SendClientMessage(playerid, COLOR_GREY, " You can't get in this car as it belongs to LS Taxi Co"); else if(IsTruckerVehicle(vehicleid) && PlayerInfo[playerid][pJob] != JOB_TRUCKER) SendClientMessage(playerid, COLOR_GREY, " You can't get in this car as it belongs to the Truckers."); else if(IsGovVehicle(vehicleid) && PlayerInfo[playerid][pFac] != 2) SendClientMessage(playerid, COLOR_GREY, " You can't get in this car as it belongs to the GOV."); else if(IsSAAFVehicle(vehicleid) && PlayerInfo[playerid][pFac] != 11) SendClientMessage(playerid, COLOR_GREY, " You can't get in this car as it belongs to the SA Air Force."); else if(IsDOCVehicle(vehicleid) && PlayerInfo[playerid][pFac] != 13) SendClientMessage(playerid, COLOR_GREY, " You can't get in this car as it belongs to the Department Of Correct."); else if(IsSASDVehicle(vehicleid) && PlayerInfo[playerid][pFac] != 8) SendClientMessage(playerid, COLOR_GREY, " You can't get in this car as it belongs to the San Andreas Sherrif Department."); else if(IsMinerVehicle(vehicleid) && PlayerInfo[playerid][pJob] != JOB_MINER) SendClientMessage(playerid, COLOR_GREY, " You can't get in this car as it belongs to the Miner job."); else if(IsMinerTruckVehicle(vehicleid) && PlayerInfo[playerid][pJob] != JOB_MINER) SendClientMessage(playerid, COLOR_GREY, " You can't get in this car as it belongs to the Miner job."); else return 1; if(!ispassenger) { new Float:pos[3]; GetPlayerPos(playerid, pos[0], pos[1], pos[2]); SetPlayerPos(playerid, pos[0], pos[1], pos[2]); }
stock IsMinerVehicle(vehicleid)
{
for(new i=0; i<sizeof(MinerCar); i++)
{
if(vehicleid == MinerCar[i]) return 1;
}
return 0;
}
else if(IsFamVehicle(vehicleid) && Fam[vehicleid] != PlayerInfo[playerid][pFam] && !IsACop(vehicleid) && !IsADOC(vehicleid) && !IsASAAF(vehicleid) && !IsSASD(vehicleid))
{
new Float:pos[3];
GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
SetPlayerPos(playerid, pos[0], pos[1], pos[2]);
SendClientMessage(playerid, COLOR_ORANGE, " You can't get in this car as it belongs to a family.");
}
else if(IsLeoVehicle(vehicleid) && PlayerInfo[playerid][pFac] != 1)
{
new Float:pos[3];
GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
SetPlayerPos(playerid, pos[0], pos[1], pos[2]);
SendClientMessage(playerid, COLOR_GREY, " You can't get in this car as it belongs to the LSPD.");
}
else if(IsLSFMDVehicle(vehicleid) && PlayerInfo[playerid][pFac] != 5)
{
new Float:pos[3];
GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
SetPlayerPos(playerid, pos[0], pos[1], pos[2]);
SendClientMessage(playerid, COLOR_GREY, " You can't get in this car as it belongs to the LSFMD.");
}
The loops may be cousing more lag to server but it doesnt couse the script not to work.
|