new string[64] ; FreezePlayer(playerid, 3000); DisablePlayerCheckpoint(playerid); GameTextForPlayer(playerid, "~g~Passengers UnLoading !", 2000, 4); SetPlayerScore(playerid, GetPlayerScore(playerid) + 1); new string[128]; new RandomPay = random(50000 - 10000) + 10000; GivePlayerMoney( playerid, RandomPay ); SendClientMessage(playerid, COLOR_RED,"-------------------------"); format(string, sizeof(string), " You Have Got Paycheck Of => $%i", RandomPay); 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 string[64]
...
new string[128];
public OnPlayerEnterCheckpoint(playerid) { switch(MissionStage[playerid]) { case STAGE_IDLE: {} // do not remove case STAGE_UNLOAD: { new string[64] ; FreezePlayer(playerid, 3000); DisablePlayerCheckpoint(playerid); GameTextForPlayer(playerid, "~g~Passengers UnLoading !", 2000, 4); SetPlayerScore(playerid, GetPlayerScore(playerid) + 1); new RandomPay = random(5000 - 20000) + 5000; GivePlayerMoney( playerid, RandomPay ); format(string, sizeof(string), " You Have Recieved $%i for Completing your Flight!", RandomPay); 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); 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) {
new string[128];
Just put it after OnPlayerEnterCheckpoint and use the same thing for formatting all strings
PHP код:
|
public OnPlayerEnterCheckpoint(playerid) {
new string[128];
switch(MissionStage[playerid]) {
case STAGE_IDLE: {} // do not remove
case STAGE_UNLOAD: {
FreezePlayer(playerid, 3000);
DisablePlayerCheckpoint(playerid);
GameTextForPlayer(playerid, "~g~Passengers UnLoading !", 2000, 4);
SetPlayerScore(playerid, GetPlayerScore(playerid) + 1);
new RandomPay = random(10000) + 5000;
GivePlayerMoney( playerid, RandomPay );
format(string, sizeof(string), " You Have Recieved $%i for Completing your Flight!", RandomPay);
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);
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;
}