20.06.2013, 12:09
Why my command is doesn't working? it was working before an hour..
My script:
No pawno errors.
My script:
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/work", cmdtext, true, 10) == 0)
{
new vehicleid = GetPlayerVehicleID(playerid);
if(GetVehicleModel(vehicleid) == 519 || GetVehicleModel(vehicleid) == 592 || GetVehicleModel(vehicleid) == 520)
{
new string[200];
new rand = random(sizeof(PilotMissionRandom));
CreatePlayerMission(playerid, PilotMissionRandom[rand][UsePlaneCheck], PilotMissionRandom[rand][MissionPay], PilotMissionRandom[rand][loadx],PilotMissionRandom[rand][loady], PilotMissionRandom[rand][loadz], PilotMissionRandom[rand][unloadx], PilotMissionRandom[rand][unloady], PilotMissionRandom[rand][unloadz]);
format(string, sizeof(string), "You are doing mission: %s", PilotMissionRandom[rand][MissionName]);
SendClientMessage(playerid, 0x00FF00FF, string);
IsPlayerInMission[playerid] = 1;
return 1;
}
else SendClientMessage(playerid, -1,"You have to be on a plane to start the flight!");
}
return 0;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(GetVehicleModel(vehicleid) == 519 || GetVehicleModel(vehicleid) == 592 || GetVehicleModel(vehicleid) == 520)
{
SendClientMessage(playerid, -1, "Info: You can start the flight by using {00FF00}/work");
}
else SendClientMessage(playerid,-1,"Sorry You can't start mission if you don't type /work");
return 0;
}
public OnPlayerEnterCheckpoint(playerid)
{
if(GetVehicleModel(GetPlayerVehicleID(playerid) == 519 || 592 || 520))
{
if(PilotJob[playerid] == 1){
PilotJob[playerid] = 2;
SetPlayerCheckpoint(playerid, 1562.4001,-2414.3513,13.5547,3.5);
SetTimerEx("LoadSf",5000, false, "i", playerid);
GameTextForPlayer(playerid,"~w~Flight ~g~ Started!", 3000, 3);
return 1;
}
if(PilotJob[playerid] == 2){
PilotJob[playerid] = 0;
DisablePlayerCheckpoint(playerid);
SendClientMessage(playerid, -1,"{CE0000}Job: You have recieved $20000 and 5 Score");
SetTimerEx("UnloadLs",8000, false, "i", playerid);
GameTextForPlayer(playerid,"~w~Flight~g~Completed!", 3000, 3);
GivePlayerMoney(playerid,20000);
SetPlayerScore(playerid,5);
}
}
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
if(PilotJob[playerid] > 0)
{
PilotJob[playerid] = 0;
SendClientMessage(playerid, -1, "Flight Cannceled Due to: You exited the plane!");
DisablePlayerCheckpoint(playerid);
}
}
public OnPlayerDeath(playerid, killerid, reason)
{
if(PilotJob[playerid] > 0)
{
PilotJob[playerid] = 0;
GameTextForPlayer(playerid,"~w~Vehicle~r~Crashed!", 3000, 3);
SendClientMessage(playerid, -1, "All Passangers are died! You have paid 2000 For it!");
GivePlayerMoney(playerid,-2000);
DisablePlayerCheckpoint(playerid);
}
}

