21.06.2013, 06:30
pawn Код:
public OnFilterScriptInit()
{
CreateVehicle(448, 2098.7107, -1821.3761, 12.8967, 0.0000, -1, -1, 100);
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp("/pwork", cmdtext, true))
{
new pvehiclemodel = GetVehicleModel(GetPlayerVehicleID(playerid));
if(IsPlayerInMission[playerid] >= 1) return SendClientMessage(playerid,-1,"You already have a mission!");
if (pvehiclemodel == 448)
{
PizzaJob[playerid] = 1;
SetPlayerCheckpoint(playerid, 2099.0190,-1806.6707,13.5551,3.5);
SendClientMessage(playerid, -1,"~g~Info: ~w~Mission started You have to go at 2 houses! Please follow the check point!");
GameTextForPlayer(playerid,"~w~Mission~g~Started!", 3000, 3);
return 1;
}
SendClientMessage(playerid, -1,"You have to be on a pizza bike to start pizza boy mission!");
}
return 0;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 448)
{
SendClientMessage(playerid,-1,"Must use /pwork to start the mission");
}
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 448)
{
if(PizzaJob[playerid] == 1){ // When he enters the first checkpoint and pizzajob is 1, it should set another checkpoint and say "Go to another house", not "mission started", because it was already started by the command...
PizzaJob[playerid] = 2;
SetPlayerCheckpoint(playerid, 1936.2399,-1923.8591,13.5469, 3.5 );
GameTextForPlayer(playerid,"~w~Go to Another House!", 3000, 3);
}
else if(PizzaJob[playerid] == 2){
PizzaJob[playerid] = 0;
DisablePlayerCheckpoint(playerid);
SendClientMessage(playerid, -1,"Info: Mission Completed! Earned 20,000$ & 5 score");
GivePlayerMoney(playerid,20000);
GameTextForPlayer(playerid,"~w~ Mission ~g~ Completed!", 3000, 3);
SetPlayerScore(playerid,GetPlayerScore(playerid)+5); // Edited here
IsPlayerInMission[playerid] = 0; // Added this
}
}
return 1;
}
CMD:pizza(playerid,params[])
{
SetPlayerPos(playerid,2021.6563, -1810.7266, 18.6016);
return 1;
}