When the vehicle is destroyed Mission ends
#3

The best way to approach this depends on a lot of factors: whether a mission involves one player or multiple players, whether there is just one ambulance, a predetermined number of ambulances or an indeterminate number of ambulances and whether each crew manages exactly one ambulance.

I would probably create an enum structure somewhat similar to:
PHP код:
#define MAX_AMBULANCE_CREW (4)
enum AmbulanceMission
{
    
ambulanceId// contains vehicleid of ambulance
    
crewIds[MAX_AMBULANCE_CREW], // contains crew members playerids
    
loaded
}
new 
gMissionInstances[5][AmbulanceMission]; // 5 being the maximum number of missions that can be started simultaneously 
PHP код:
public OnVehicleDeath(vehicleidkillerid)
{
    for(new 
isizeof gMissionInstancesi++)
    {
        if(
gMissionInstance[i][ambulanceId] == vehicleid)
        {
            
TriggerAmbulanceMissionFailed(i); // trigger a function that says instance "i" failed
            
break;
        }
    }

PHP код:
TriggerAmbulanceMissionFailed(instance)
{
    for(new 
iMAX_AMBULANCE_CREWi++)
    {
        
GameTextForPlayer(gMissionInstances[instance][crewIds][i], "~r~Mission Failed"90000);
    }

Reply


Messages In This Thread
When the vehicle is destroyed Mission ends - by cloudysky - 12.06.2017, 15:44
Re: When the vehicle is destroyed Mission ends - by FailerZ - 12.06.2017, 15:58
Re: When the vehicle is destroyed Mission ends - by Vince - 12.06.2017, 16:08
Re: When the vehicle is destroyed Mission ends - by cloudysky - 12.06.2017, 16:49

Forum Jump:


Users browsing this thread: 1 Guest(s)