A Small Favour
#1

i got a Problem

PHP код:
AirportMissionStart(playerid) {
    if(
MissionStage[playerid] == STAGE_IDLE) {
        new 
vehiclemod GetVehicleModel(GetPlayerVehicleID(playerid));
       if(
vehiclemod == 519 || vehiclemod == (593) || vehiclemod == (553) )
      {
            new
                
idx,
                
Floattmp,
                
Floatdist GetPlayerDistanceFromPoint(playeridgAirports[0][0], gAirports[0][1], gAirports[0][2])
            ;
            for(new 
1sizeof gAirports; ++i) {
                
tmp GetPlayerDistanceFromPoint(playeridgAirports[i][0], gAirports[i][1], gAirports[i][2]);
                if(
tmp dist) {
                    
dist tmp;
                    
idx i;
                }
            }
            
MissionStage[playerid] = STAGE_LOAD idx;
            return 
SetPlayerCheckpoint(playeridgAirports[idx][0], gAirports[idx][1], gAirports[idx][2], 20.0);
        }
    }
    return 
false;

when a player enter a shamal or dodo or naveda and type /work it will start a work and creates a new cp for loading
but i want to make it load if the player is only in a shamal or naveda or dodo..

here is my cp codes

PHP код:
public OnPlayerEnterCheckpoint(playerid) {
    switch(
MissionStage[playerid]) {
        case 
STAGE_IDLE: {} // do not remove
        
case STAGE_UNLOAD: {
            new
                
string[64]
            ;
            
//FreezePlayer(playerid, 3000);//i disable that for test
            
DisablePlayerCheckpoint(playerid);
            
GameTextForPlayer(playerid"~g~Passengers UnLoading !"20004);
            
//SetPlayerScore(playerid, GetPlayerScore(playerid) + 1);
            
SetPVarInt(playerid"PVarScore"1);
            
//GivePlayerMoney(playerid, 4000 + random(4000));
            
SetPVarInt(playerid"PVarMoney"4000 random(4000));
            
GetPlayerName(playeridstringMAX_PLAYER_NAME);
            
strcat(string" Completed a Flight!");
            
SendClientMessageToAll(COLOR_ORANGEstring);
            
SendClientMessage(playeridCOLOR_GREY"All Passengers had Been UnBoarded!");
            
MissionStage[playerid] = STAGE_IDLE;
        }
        default: { 
// STAGE_LOAD
            
new
                
rand random(sizeof gAirports 1)
            ;
            if(
rand == (MissionStage[playerid] - STAGE_LOAD)) {
                
rand++;
            }
            
//FreezePlayer(playerid, 3000); //i disable that for test
            
DisablePlayerCheckpoint(playerid);
            
GameTextForPlayer(playerid"~g~Passengers Boarding !"20004);
            
SetPlayerCheckpoint(playeridgAirports[rand][0], gAirports[rand][1], gAirports[rand][2], 10.0);
            
SendClientMessage(playeridCOLOR_GREY"All Passengers has Been Boarded and Fastened Their Seat Belts!");
            
MissionStage[playerid] = STAGE_UNLOAD;
        }
    }
    return 
false;

Reply


Messages In This Thread
A Small Favour - by Shaheen - 26.03.2016, 12:29
Re: A Small Favour - by Shaheen - 26.03.2016, 16:45
Re: A Small Favour - by Shaheen - 27.03.2016, 08:21
Re: A Small Favour - by K0P - 27.03.2016, 08:26
Re: A Small Favour - by Shaheen - 28.03.2016, 02:40
Re: A Small Favour - by Sew_Sumi - 28.03.2016, 05:57
Re: A Small Favour - by Shaheen - 28.03.2016, 10:40
Re: A Small Favour - by RUBHRUBHH - 28.03.2016, 11:16
Re: A Small Favour - by Shaheen - 28.03.2016, 14:13
Re: A Small Favour - by SyS - 28.03.2016, 15:23

Forum Jump:


Users browsing this thread: 2 Guest(s)