AirportMissionStart(playerid) {
if(MissionStage[playerid] == STAGE_IDLE) {
new vehiclemod = GetVehicleModel(GetPlayerVehicleID(playerid));
if(vehiclemod == 519 || vehiclemod == (593) || vehiclemod == (553) )
{
new
idx,
Float: tmp,
Float: dist = GetPlayerDistanceFromPoint(playerid, gAirports[0][0], gAirports[0][1], gAirports[0][2])
;
for(new i = 1; i < sizeof gAirports; ++i) {
tmp = GetPlayerDistanceFromPoint(playerid, gAirports[i][0], gAirports[i][1], gAirports[i][2]);
if(tmp < dist) {
dist = tmp;
idx = i;
}
}
MissionStage[playerid] = STAGE_LOAD + idx;
return SetPlayerCheckpoint(playerid, gAirports[idx][0], gAirports[idx][1], gAirports[idx][2], 20.0);
}
}
return false;
}
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 !", 2000, 4);
//SetPlayerScore(playerid, GetPlayerScore(playerid) + 1);
SetPVarInt(playerid, "PVarScore", 1);
//GivePlayerMoney(playerid, 4000 + random(4000));
SetPVarInt(playerid, "PVarMoney", 4000 + random(4000));
GetPlayerName(playerid, string, MAX_PLAYER_NAME);
strcat(string, " Completed a Flight!");
SendClientMessageToAll(COLOR_ORANGE, string);
SendClientMessage(playerid, COLOR_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 !", 2000, 4);
SetPlayerCheckpoint(playerid, gAirports[rand][0], gAirports[rand][1], gAirports[rand][2], 10.0);
SendClientMessage(playerid, COLOR_GREY, "All Passengers has Been Boarded and Fastened Their Seat Belts!");
MissionStage[playerid] = STAGE_UNLOAD;
}
}
return false;
}
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 !", 2000, 4);
//SetPlayerScore(playerid, GetPlayerScore(playerid) + 1);
SetPVarInt(playerid, "PVarScore", 1);
//GivePlayerMoney(playerid, 4000 + random(4000));
SetPVarInt(playerid, "PVarMoney", 4000 + random(4000));
GetPlayerName(playerid, string, MAX_PLAYER_NAME);
strcat(string, " Completed a Flight!");
SendClientMessageToAll(COLOR_ORANGE, string);
if(GetVehicleModel(vehicleid) == 519) // 411 is the Infernus model
else
return 0;
SendClientMessage(playerid, COLOR_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); // disable that for test
DisablePlayerCheckpoint(playerid);
GameTextForPlayer(playerid, "~g~Passengers Boarding !", 2000, 4);
SetPlayerCheckpoint(playerid, gAirports[rand][0], gAirports[rand][1], gAirports[rand][2], 10.0);
SendClientMessage(playerid, COLOR_GREY, "All Passengers has Been Boarded and Fastened Their Seat Belts!");
MissionStage[playerid] = STAGE_UNLOAD;
}
}
return false;
}
C:\Users\Farha\Desktop\New folder\filterscripts\Untitled11.pwn(136) : error 029: invalid expression, assumed zero
C:\Users\Farha\Desktop\New folder\filterscripts\Untitled11.pwn(136 -- 137) : warning 215: expression has no effect
C:\Users\Farha\Desktop\New folder\filterscripts\Untitled11.pwn(137) : error 001: expected token: ";", but found "return"
C:\Users\Farha\Desktop\New folder\filterscripts\Untitled11.pwn(138) : warning 225: unreachable code
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
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 !", 2000, 4); //SetPlayerScore(playerid, GetPlayerScore(playerid) + 1); SetPVarInt(playerid, "PVarScore", 1); //GivePlayerMoney(playerid, 4000 + random(4000)); SetPVarInt(playerid, "PVarMoney", 4000 + random(4000)); GetPlayerName(playerid, string, MAX_PLAYER_NAME); strcat(string, " Completed a Flight!"); SendClientMessageToAll(COLOR_ORANGE, string); if(GetVehicleModel(vehicleid) == 519) // 411 is the Infernus model else return 0; SendClientMessage(playerid, COLOR_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); // disable that for test DisablePlayerCheckpoint(playerid); GameTextForPlayer(playerid, "~g~Passengers Boarding !", 2000, 4); SetPlayerCheckpoint(playerid, gAirports[rand][0], gAirports[rand][1], gAirports[rand][2], 10.0); SendClientMessage(playerid, COLOR_GREY, "All Passengers has Been Boarded and Fastened Their Seat Belts!"); MissionStage[playerid] = STAGE_UNLOAD; } } return false; }
Try this:
Код:
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 !", 2000, 4); //SetPlayerScore(playerid, GetPlayerScore(playerid) + 1); SetPVarInt(playerid, "PVarScore", 1); //GivePlayerMoney(playerid, 4000 + random(4000)); SetPVarInt(playerid, "PVarMoney", 4000 + random(4000)); GetPlayerName(playerid, string, MAX_PLAYER_NAME); strcat(string, " Completed a Flight!"); SendClientMessageToAll(COLOR_ORANGE, string); if(GetVehicleModel(vehicleid) == 519) // 411 is the Infernus model else return 0; SendClientMessage(playerid, COLOR_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); // disable that for test DisablePlayerCheckpoint(playerid); GameTextForPlayer(playerid, "~g~Passengers Boarding !", 2000, 4); SetPlayerCheckpoint(playerid, gAirports[rand][0], gAirports[rand][1], gAirports[rand][2], 10.0); SendClientMessage(playerid, COLOR_GREY, "All Passengers has Been Boarded and Fastened Their Seat Belts!"); MissionStage[playerid] = STAGE_UNLOAD; } } return false; } |
if(rand == (MissionStage[playerid] - STAGE_LOAD)) {
errors is not the problem but i want to check if the player is in shamal,dodo or naveda when enterting a cp
|
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 !", 2000, 4); //SetPlayerScore(playerid, GetPlayerScore(playerid) + 1); SetPVarInt(playerid, "PVarScore", 1); //GivePlayerMoney(playerid, 4000 + random(4000)); SetPVarInt(playerid, "PVarMoney", 4000 + random(4000)); GetPlayerName(playerid, string, MAX_PLAYER_NAME); strcat(string, " Completed a Flight!"); SendClientMessageToAll(COLOR_ORANGE, string); if(GetVehicleModel(vehicleid) == 519) // 411 is the Infernus model else return 0; SendClientMessage(playerid, COLOR_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); // disable that for test DisablePlayerCheckpoint(playerid); GameTextForPlayer(playerid, "~g~Passengers Boarding !", 2000, 4); SetPlayerCheckpoint(playerid, gAirports[rand][0], gAirports[rand][1], gAirports[rand][2], 10.0); SendClientMessage(playerid, COLOR_GREY, "All Passengers has Been Boarded and Fastened Their Seat Belts!"); MissionStage[playerid] = STAGE_UNLOAD; } } return false; }
public OnPlayerEnterCheckpoint(playerid) {
if(GetVehicleModel(vehicleid) !=519 || GetVehicleModel(vehicleid) !=593 ) return 0; //check player in shamal or dodo
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 !", 2000, 4);
//SetPlayerScore(playerid, GetPlayerScore(playerid) + 1);
SetPVarInt(playerid, "PVarScore", 1);
//GivePlayerMoney(playerid, 4000 + random(4000));
SetPVarInt(playerid, "PVarMoney", 4000 + random(4000));
GetPlayerName(playerid, string, MAX_PLAYER_NAME);
strcat(string, " Completed a Flight!");
SendClientMessageToAll(COLOR_ORANGE, string);
SendClientMessage(playerid, COLOR_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); // disable that for test
DisablePlayerCheckpoint(playerid);
GameTextForPlayer(playerid, "~g~Passengers Boarding !", 2000, 4);
SetPlayerCheckpoint(playerid, gAirports[rand][0], gAirports[rand][1], gAirports[rand][2], 10.0);
SendClientMessage(playerid, COLOR_GREY, "All Passengers has Been Boarded and Fastened Their Seat Belts!");
MissionStage[playerid] = STAGE_UNLOAD;
}
}
return false;
}