Command Doesn't Work?
#1

Why my command is doesn't working? it was working before an hour..

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);
	}
}
No pawno errors.
Reply


Messages In This Thread
Command Doesn't Work? - by Tuntun - 20.06.2013, 12:09
Re: Command Doesn't Work? - by S0n1COwnsYou - 20.06.2013, 12:26
Re: Command Doesn't Work? - by Tuntun - 20.06.2013, 12:41
Re: Command Doesn't Work? - by S0n1COwnsYou - 20.06.2013, 12:44
Re: Command Doesn't Work? - by Tuntun - 20.06.2013, 12:49
Re: Command Doesn't Work? - by S0n1COwnsYou - 20.06.2013, 12:51
Re: Command Doesn't Work? - by Tuntun - 20.06.2013, 12:52
Re: Command Doesn't Work? - by S0n1COwnsYou - 20.06.2013, 12:54
Re: Command Doesn't Work? - by Tuntun - 20.06.2013, 13:00

Forum Jump:


Users browsing this thread: 1 Guest(s)