PDA

View Full Version : multiple checkpoint mission


livests
02/03/2012, 08:55 AM
hy i make mission with more than load and unload but then i go to load place i load cargo checkpoint disapears and i cant move and its same in roadwork mission i have one cp i drive in it shows repairing.. cp disapear and i cant move, taxi mission with two checkpoints works good.


enum Fueltruckinfo //Petrol tank trailer, model 584
{
Pay,
Mtext[200],
Float:Firstx,
Float:Firsty,
Float:Firstz,
Float:Nextx,
Float:Nextz,
Float:Nexty,
Float:Next1x,
Float:Next1y,
Float:Next1z,
Float:Lastx,
Float:Lasty,
Float:Lastz
}

new FInfo[MAX_PLAYERS][Fueltruckinfo];

new FueltruckMissions[][Fueltruckinfo]=
{
{2000,"Deliver fuel to 3 locations",-104.9665,-326.2715,1.1569,-96.3130,-1163.8553,2.4082,-1606.1223,-2714.0071,48.5335,629.8965,1692.9579,7.5604},
{17000,"Deliver fuel to 3 locations",-1712.8076,392.0547,7.1797,2116.5847,920.1676,10.82 03,611.6620,1694.9224,6.9922,578.2017,1436.4266,11 .1406},
{9000,"Deliver fuel to 3 locations",-1025.1323,-676.8685,32.0078,-2023.6333,156.2986,28.8359,1938.3922,-1771.5518,13.3828,625.6339,1670.1246,6.9922},
{9000,"Deliver fuel to 3 locations",2825.9961,972.3922,10.7500,-1326.0250,2677.1208,51.0827,2946.0940,-2053.6970,0.0279,704.2693,-456.1251,16.3359}
};

if(GetVehicleModel(GetVehicleTrailer(GetPlayerVehi cleID(playerid))) == 584)
{
workingvehicle[playerid] = GetPlayerVehicleID(playerid);
LoadCP[playerid] = 10;
new rand = random(sizeof(FueltruckMissions));
SetPlayerCheckpoint(playerid,FueltruckMissions[rand][Firstx],FueltruckMissions[rand][Firsty],FueltruckMissions[rand][Firstz],5.0);
format(string, sizeof(string), "MISSION: "lyellow2"%s", FueltruckMissions[rand][Mtext]);
SendClientMessage(playerid,orange,string);
FInfo[playerid][Pay] = FueltruckMissions[rand][Pay];
FInfo[playerid][Nextx] = FueltruckMissions[rand][Nextx];
FInfo[playerid][Nexty] = FueltruckMissions[rand][Nexty];
FInfo[playerid][Nextz] = FueltruckMissions[rand][Nextz];
FInfo[playerid][Next1x] = FueltruckMissions[rand][Next1x];
FInfo[playerid][Next1y] = FueltruckMissions[rand][Next1y];
FInfo[playerid][Next1z] = FueltruckMissions[rand][Next1z];
FInfo[playerid][Lastx] = FueltruckMissions[rand][Lastx];
FInfo[playerid][Lasty] = FueltruckMissions[rand][Lasty];
FInfo[playerid][Lastz] = FueltruckMissions[rand][Lastz];
}

else if(LoadCP[playerid] == 10)
{
SetTimerEx("Load...",6000,false,"i",playerid);
GameTextForPlayer(playerid,"~g~~h~Loading...",6000,3);
TogglePlayerControllable(playerid,0);
SetCameraBehindPlayer(playerid);
}
else if(LoadCP[playerid] == 11)
{
SetTimerEx("Load...",6000,false,"i",playerid);
GameTextForPlayer(playerid,"~g~~h~Unload",6000,3);
TogglePlayerControllable(playerid,0);
SetCameraBehindPlayer(playerid);
}
else if(LoadCP[playerid] == 12)
{
SetTimerEx("Load...",6000,false,"i",playerid);
GameTextForPlayer(playerid,"~g~~h~Unload",6000,3);
TogglePlayerControllable(playerid,0);
SetCameraBehindPlayer(playerid);
}
else if(LoadCP[playerid] == 13)
{
SetTimerEx("Load...",6000,false,"i",playerid);
GameTextForPlayer(playerid,"~g~~h~Unload",6000,3);
TogglePlayerControllable(playerid,0);
SetCameraBehindPlayer(playerid);
}
}
return 1;
}

public Loadingfuel(playerid)
{
if(LoadCP[playerid] == 10)
{
TogglePlayerControllable(playerid,1);
GameTextForPlayer(playerid,"~g~Loading...!",6000,3);
SetPlayerCheckpoint(playerid,FInfo[playerid][Nextx],FInfo[playerid][Nexty],FInfo[playerid][Nextz],4.0);
LoadCP[playerid] = 11;
}
else if(LoadCP[playerid] == 11)
{
TogglePlayerControllable(playerid,1);
GameTextForPlayer(playerid,"~g~Unloading...!",6000,3);
SetPlayerCheckpoint(playerid,FInfo[playerid][Next1x],FInfo[playerid][Next1y],FInfo[playerid][Next1z],4.0);
LoadCP[playerid] = 12;
}
else if(LoadCP[playerid] == 12)
{
TogglePlayerControllable(playerid,1);
GameTextForPlayer(playerid,"~g~Unloading...!",6000,3);
SetPlayerCheckpoint(playerid,FInfo[playerid][Lastx],FInfo[playerid][Lasty],FInfo[playerid][Lastz],4.0);
LoadCP[playerid] = 13;
}
else if(LoadCP[playerid] == 13)
{
DisablePlayerCheckpoint(playerid);
TogglePlayerControllable(playerid,1);
GameTextForPlayer(playerid,"~g~Unloading!",6000,3);
LoadCP[playerid] = 0;
SendFMessage(playerid, red,"[Fueltruck] "lgreen2"You have earned "lblue"%i "lgreen2"for transporting fuel.",FInfo[playerid][Pay]);
GivePlayerMoney(playerid,FInfo[playerid][Pay]);
PInfo[playerid][Missionspassed]++;
SetPlayerScore(playerid,PInfo[playerid][Missionspassed]);
IsPlayerInMission[playerid] = 0;
TogglePlayerAllDynamicCPs(playerid, 1);
{
new file[128];
format(file,sizeof(file),"Admin/Users/%s.ini",GetPName(playerid));
INI_Open(file);
INI_WriteInt("Truckingdone",INI_ReadInt("Truckingdone")+1);
INI_Save();
INI_Close();
}
}
return 1;
}