work cmd problem
#1

the first job id works fine but when i try to start the second job the job vehicle says i nee to be in the right vehicle but there is nothing wrong with the jobcar coding

Quote:

enum JobCars
{
wf1, wf2, wf3, wf4, wf5, Sad1, Sad2, Sad3, Sad4, Sad5
}

new JobCar[JobCars];

//OnGameModeInit
JobCar[wf1] = AddStaticVehicle(532,-1186.8595,-1074.8660,130.1983,97.9627,0,0);
JobCar[wf2] = AddStaticVehicle(532,-1185.3960,-1084.2224,130.1962,94.7333,0,0);
JobCar[wf3] = AddStaticVehicle(532,-1184.5419,-1093.0392,130.1978,93.8195,0,0);
JobCar[wf4] = AddStaticVehicle(532,-1183.7208,-1102.1256,130.2081,94.3945,0,0);
JobCar[wf5] = AddStaticVehicle(532,-1170.0876,-1101.3213,130.1925,93.2354,0,0);

JobCar[Sad1] = AddStaticVehicle(609,-1719.2181,-124.0098,3.6294,136.8692,40,0);
JobCar[Sad2] = AddStaticVehicle(609,-1722.0605,-121.3772,3.6312,136.8500,40,0);
JobCar[Sad3] = AddStaticVehicle(609,-1724.9011,-118.8117,3.6417,138.6687,40,0);
JobCar[Sad4] = AddStaticVehicle(609,-1727.7406,-116.3403,3.6443,139.3643,40,0);
JobCar[Sad5] = AddStaticVehicle(609,-1730.5371,-113.2835,3.6524,136.6388,40,0);

//OnPlayerStateChange
if(CarCheck == JobCar[wf1]
|| CarCheck == JobCar[wf2]
|| CarCheck == JobCar[wf3]
|| CarCheck == JobCar[wf4]
|| CarCheck == JobCar[wf5])
{
if(PlayerInfo[playerid][pJob] != 1)
{
SCM(playerid, COLOR_WHITE,"You are not allowed to enter this vehicle. (Job-Vehicle)");
RemovePlayerFromVehicle(playerid);
TogglePlayerControllable(playerid, 1);
return 1;
}
else
{
return 1;
}
}
if(CarCheck == JobCar[Sad1]
|| CarCheck == JobCar[Sad2]
|| CarCheck == JobCar[Sad3]
|| CarCheck == JobCar[Sad4]
|| CarCheck == JobCar[Sad5])
{
if(PlayerInfo[playerid][pJob] != 2)
{
SCM(playerid, COLOR_WHITE,"You are not allowed to enter this vehicle. (Job-Vehicle)");
RemovePlayerFromVehicle(playerid);
TogglePlayerControllable(playerid, 1);
return 1;
}
else
{
return 1;
}
}

CMD:work(playerid, params[])
{
if(JobTime[playerid] == 1) return SCM(playerid, C_RED,"You cant Start this job yet it has not ben 5 minute's yet");
if(PlayerInfo[playerid][pJob] == 1)
{
if(IsPlayerInVehicle(playerid, JobCar[wf1]))
{
JobDrugFarm[playerid] = 1;
SetPlayerCheckpoint(playerid, -1211.5420,-1065.9420,129.2439, 3.0);
SCM(playerid, C_WHITE, "Your Job has started");
return 1;
}
SCM(playerid, C_RED, "You need too be in the corect vehicle befor starting this job");
}
if(PlayerInfo[playerid][pJob] == 2)
{
if(IsPlayerInVehicle(playerid, JobCar[Sad1] && JobCar[Sad2] && JobCar[Sad3] && JobCar[Sad4] && JobCar[Sad5]))
{
JobSaDelivery[playerid] = 1;
SetPlayerCheckpoint(playerid, -1744.2125,-118.1618,3.5547,3.0);
SCM(playerid, C_WHITE, "Your Job has started");
return 1;
}
SCM(playerid, C_RED, "You need too be in the corect vehicle befor starting this job");
}
return 1;
}

Reply
#2

use OR ( || ) operator insted of AND ( && )
Reply
#3

i tryd that it did not work
Reply
#4

i updated it with my jobcar code maby that will help
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)