14.06.2014, 18:49
PHP код:
public OnPlayerEnterRaceCheckpoint(playerid)
{
new string[256];
/*
SetPlayerRaceCheckpoint(playerid, type, Float:x, Float:y, Float:z, Float:nextx, Float:nexty, Float:nextz, Float:size)
Playerid The ID of the player to set the checkpoint for
Type type of checkpoint.0-Normal, 1-Finish, 2-Nothing(Only the checkpoint without anything on it), 3-Air normal, 4-Air finish
Float:x X-Coordinate
Float:y Y-Coordinate
Float:z Z-Coordinate
Float:nextx X-Coordinate of the next point, for the arrow facing direction
Float:nexty Y-Coordinate of the next point, for the arrow facing direction
Float:nextz Z-Coordinate of the next point, for the arrow facing direction
Float:size Size (diameter) of the checkpoint
*/
switch (PlayerInfo[playerid][pMission])
{
case MISSION_TYPE_KIDNAP:
{
DisablePlayerRaceCheckpoint(playerid);
PlayerInfo[playerid][pRaceCheckpoint] = 0;
}
case MISSION_TYPE_POLICE_RESPOND:
{
DisablePlayerRaceCheckpoint(playerid);
PlayerInfo[playerid][pRaceCheckpoint] = 0;
if (Police_Responding_Id > -1)
{
Police_Responding_Id = -1;
Police_Responding_Time = 0;
Police_Responding_To_Crime = 0;//0 = Backup call, 1 = 911 call, 2 = crime
strmid(Police_Responding_Text, " ", 0, 128, 128);
}
}
case MISSION_TYPE_COURIER_1:
{
if (GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
new Mission = PlayerInfo[playerid][pMissionSlot];
PlayerInfo[playerid][pMissionBonus] = 200000;
//format(string, sizeof(string), "Deliver %s To %s",CourierMissionInfo[Mission][cm_goods],CourierMissionInfo[Mission][cm_del_location]);
//SendClientMessage(playerid, COLOR_SERVER_HELP_MSG, string);
GameTextForPlayer(playerid,"~w~COURIER MISSION DELIVER TO THE~n~~r~CHECKPOINT",5000,3);
ShowTextDrawMenu(playerid, TD_MENU_INFO,"~b~Courier Mission", 10, 0);
//format(string, sizeof(string), "Deliver ~p~%s~n~~w~To ~b~%s ~w~In ~p~%s~n~~w~Enter The ~r~Checkpoint ~w~At The Destination~n~Distance Bonus: ~g~$20000 ~W~- ~g~$45 / Game Minute~n~~w~Pickup Bonus ~g~$10000~w~~n~You Have ~p~12 Hours ~w~To Complete The Delivery~n~~w~Press ~y~2 ~w~For Delivery Information~n~~w~Type ~y~/cancel ~w~To Cancel Delivery",CourierMissionInfo[Mission][cm_goods],CourierMissionInfo[Mission][cm_del_location],CourierMissionInfo[Mission][cm_del_location_cont]);
format(string, sizeof(string), "Deliver ~p~%s~n~~w~To ~b~%s ~w~In ~p~%s~n~~w~Enter The ~r~Checkpoint ~w~At The Destination~n~Distance Bonus: ~g~$20000 ~W~- ~g~$45 / Game Minute~n~~w~Pickup Bonus ~g~$10000~n~ ",CourierMissionInfo[Mission][cm_goods],CourierMissionInfo[Mission][cm_del_location],CourierMissionInfo[Mission][cm_del_location_cont]);
ShowTextDrawMenuItems(playerid, 0, string, " ", " ",0);
format(string, sizeof(string), " ~n~ ~n~ ~n~ ~n~ ~n~You Have ~p~12 Hours ~w~To Complete The Delivery~n~~w~Press ~y~2 ~w~For Delivery Information~n~~w~Type ~y~/cancel ~w~To Cancel Delivery");
TextDrawSetString(Menu_StatsCont[playerid], string);
TextDrawShowForPlayer(playerid, Menu_StatsCont[playerid]);
PlayerInfo[playerid][pWantedLevel] = 6;
format(string, sizeof(string), "Crime: Smuggling Illegal Items");
ReportCrimeTOPolice(playerid,string);
SetPlayerWantedStats(playerid,"Smuggling Illegal Items");
SetPlayerRaceCheckpoint(playerid, 2, CourierMissionInfo[Mission][cm_del_cp_x],CourierMissionInfo[Mission][cm_del_cp_y],CourierMissionInfo[Mission][cm_del_cp_z], 0,0,0, 4);
PlayerInfo[playerid][pMission] = MISSION_TYPE_COURIER_2;
}
}
case MISSION_TYPE_COURIER_2:
{
if (GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
new Mission = PlayerInfo[playerid][pMissionSlot];
//Delivery Complete. Received $26042 + $15890 Time Bonus. Pickup Bonus: $11568
//format(string, sizeof(string), "You Have Successfully Delivered %s From %s To %s In %d Hours, %d Minutes.",CourierMissionInfo[Mission][cm_goods],CourierMissionInfo[Mission][cm_pkup_location],CourierMissionInfo[Mission][cm_del_location],PlayerInfo[playerid][pMissionHour],PlayerInfo[playerid][pMissionMinute]);
//SendClientMessage(playerid, COLOR_SERVER_HELP_MSG, string);
GameTextForPlayer(playerid,"~w~COURIER MISSION COMPLETED!",5000,3);
ShowTextDrawMenu(playerid, TD_MENU_INFO,"~b~Delivery Complete", 5, 0);
format(string, sizeof(string), "~p~%s ~w~Successfully Delivered~n~To ~b~%s ~w~In ~b~%s~n~ ~n~~w~Time: ~p~%d Hours, %d Minutes~n~~w~Received ~g~$25000 ~w~+ ~g~$32020 ~w~Bonus",CourierMissionInfo[Mission][cm_goods],CourierMissionInfo[Mission][cm_del_location],CourierMissionInfo[Mission][cm_del_location_cont],PlayerInfo[playerid][pMissionHour],PlayerInfo[playerid][pMissionMinute]);
ShowTextDrawMenuItems(playerid, 0, string, " ", " ",0);
format(string, sizeof(string), "~b~%s (%d) ~w~Has Delivered ~p~%s ~w~From ~b~%s ~w~To~n~~b~%s ~w~In ~g~%d Hours, %d Minutes.",PlayerInfo[playerid][pName],playerid,CourierMissionInfo[Mission][cm_goods],CourierMissionInfo[Mission][cm_pkup_location],CourierMissionInfo[Mission][cm_del_location],PlayerInfo[playerid][pMissionHour],PlayerInfo[playerid][pMissionMinute]);
SendClientOnScreenText(playerid,string);
PlayerPlaySound(playerid, 1058, 0.0, 0.0, 0.0);
DisablePlayerRaceCheckpoint(playerid);
PlayerInfo[playerid][pMission] = 0;
PlayerInfo[playerid][pRaceCheckpoint] = 0;
GivePlayerMoney(playerid,5000);
PlayerInfo[playerid][pEarnings] += 5000;
TextDrawHideForPlayer(playerid, StatsDisplay[playerid]);
}
}
case MISSION_TYPE_TRUCK_1:
{
if (GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
new Mission = PlayerInfo[playerid][pMissionSlot];
PlayerInfo[playerid][pMissionBonus] = 200000;
//format(string, sizeof(string), "Deliver %s To %s",TruckMissionInfo[Mission][tm_goods],TruckMissionInfo[Mission][tm_del_location]);
//SendClientMessage(playerid, COLOR_SERVER_HELP_MSG, string);
GameTextForPlayer(playerid,"~w~TRUCK DELIVERY DELIVER TO THE~n~~r~CHECKPOINT",5000,3);
ShowTextDrawMenu(playerid, TD_MENU_INFO,"~b~Truck Delivery", 7, 0);
//format(string, sizeof(string), "Deliver ~p~%s~n~~w~To ~b~%s~n~~w~Enter The ~r~Checkpoint ~w~At The Destination~n~Distance Bonus: ~g~$20000 ~W~- ~g~$45 / Game Minute~n~~w~Pickup Bonus ~g~$10000~w~~n~You Have ~p~12 Hours ~w~To Complete The Delivery~n~~w~Press ~y~2 ~w~For Delivery Information~n~~w~Type ~y~/cancel ~w~To Cancel Delivery",TruckMissionInfo[Mission][tm_goods],TruckMissionInfo[Mission][tm_del_location]);//~n~Keep Your ~p~Trailer For A Bonus~w~
format(string, sizeof(string), "Deliver ~p~%s~n~~w~To ~b~%s~n~~w~Enter The ~r~Checkpoint ~w~At The Destination~n~Distance Bonus: ~g~$20000 ~W~- ~g~$45 / Game Minute~n~~w~Pickup Bonus ~g~$10000~n~ ",TruckMissionInfo[Mission][tm_goods],TruckMissionInfo[Mission][tm_del_location]);//~n~Keep Your ~p~Trailer For A Bonus~w~
ShowTextDrawMenuItems(playerid, 0, string, " ", " ",0);
format(string, sizeof(string), " ~n~ ~n~ ~n~ ~n~ ~n~You Have ~p~12 Hours ~w~To Complete The Delivery~n~~w~Press ~y~2 ~w~For Delivery Information~n~~w~Type ~y~/cancel ~w~To Cancel Delivery");
TextDrawSetString(Menu_StatsCont[playerid], string);
TextDrawShowForPlayer(playerid, Menu_StatsCont[playerid]);
//PlayerInfo[playerid][pWantedLevel] = 6;
//format(string, sizeof(string), "Crime: Smuggling Illegal Items");
//ReportCrimeTOPolice(playerid,string);
//SetPlayerWantedStats(playerid,"Smuggling Illegal Items");
SetPlayerRaceCheckpoint(playerid, 2, TruckMissionInfo[Mission][tm_del_cp_x],TruckMissionInfo[Mission][tm_del_cp_y],TruckMissionInfo[Mission][tm_del_cp_z], 0,0,0, 4);
PlayerInfo[playerid][pMission] = MISSION_TYPE_TRUCK_2;
GivePlayerMoney(playerid,10000);
PlayerInfo[playerid][pEarnings] += 10000;
}
}
case MISSION_TYPE_TRUCK_2:
{
if (GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
new Mission = PlayerInfo[playerid][pMissionSlot];
//Delivery Complete. Received $26042 + $15890 Time Bonus. Pickup Bonus: $11568
//format(string, sizeof(string), "You Have Successfully Delivered %s From %s To %s In %d Hours, %d Minutes.",TruckMissionInfo[Mission][tm_goods],TruckMissionInfo[Mission][tm_pkup_location],TruckMissionInfo[Mission][tm_del_location],PlayerInfo[playerid][pMissionHour],PlayerInfo[playerid][pMissionMinute]);
//SendClientMessage(playerid, COLOR_SERVER_HELP_MSG, string);
GameTextForPlayer(playerid,"~w~TRUCK DELIVERY COMPLETED!",5000,3);
ShowTextDrawMenu(playerid, TD_MENU_INFO,"~b~Delivery Complete", 7, 0);
format(string, sizeof(string), "~p~%s ~w~Successully Delivered~n~~w~From ~b~%s ~w~To ~b~%s~n~~w~Time: ~p~%d Hours, %d Minutes~n~~w~Received ~g~$5678 ~w~+ ~g~$4907 ~w~Time Bonus~n~Pickup Bonus ~g~$14000",TruckMissionInfo[Mission][tm_goods],TruckMissionInfo[Mission][tm_pkup_location],TruckMissionInfo[Mission][tm_del_location],PlayerInfo[playerid][pMissionHour],PlayerInfo[playerid][pMissionMinute]);//~n~Keep Your ~p~Trailer For A Bonus~w~
ShowTextDrawMenuItems(playerid, 0, string, " ", " ",0);
format(string, sizeof(string), "~b~%s (%d) ~w~Has Delivered ~p~%s ~w~From ~b~%s ~w~To~n~~b~%s ~w~In ~g~%d Hours, %d Minutes.",PlayerInfo[playerid][pName],playerid,TruckMissionInfo[Mission][tm_goods],TruckMissionInfo[Mission][tm_pkup_location],TruckMissionInfo[Mission][tm_del_location],PlayerInfo[playerid][pMissionHour],PlayerInfo[playerid][pMissionMinute]);
SendClientOnScreenText(playerid,string);
PlayerPlaySound(playerid, 1058, 0.0, 0.0, 0.0);
DisablePlayerRaceCheckpoint(playerid);
PlayerInfo[playerid][pMission] = 0;
PlayerInfo[playerid][pRaceCheckpoint] = 0;
GivePlayerMoney(playerid,5000);
PlayerInfo[playerid][pEarnings] += 5000;
TextDrawHideForPlayer(playerid, StatsDisplay[playerid]);
}
}
case MISSION_TYPE_BANK_ROBBERY_2:
{
if (GetPlayerState(playerid) == PLAYER_STATE_DRIVER && PLAYER_STATE_ONFOOT)
{
format(string, sizeof(string), "~w~BANK ROBBERY COMPLETE~n~~y~ROBBED $%d",PlayerInfo[playerid][pHoldupAmount]);
GameTextForPlayer(playerid,string, 5000, 3);
ShowTextDrawMenu(playerid, TD_MENU_INFO,"~g~Bank Robbery", 6, 0);
format(string, sizeof(string), "~w~You Have Successfully Reached Your ~p~Hideout~n~~w~You Cracked The Safe And Found ~g~$%d~n~~w~You Have Evaded The ~b~Police~n~~w~Your ~r~Wanted Level ~w~Has Been Lowered",PlayerInfo[playerid][pHoldupAmount]);
ShowTextDrawMenuItems(playerid, 0, string, " ", " ",0);
PlayerPlaySound(playerid, 1058, 0.0, 0.0, 0.0);
DisablePlayerRaceCheckpoint(playerid);
PlayerInfo[playerid][pRaceCheckpoint] = 0;
PlayerInfo[playerid][pMission] = 0;
PlayerInfo[playerid][pHoldup] = 0;
if (PlayerInfo[playerid][pHoldupAmount] > 0)
{
GivePlayerMoney(playerid,PlayerInfo[playerid][pHoldupAmount]);
PlayerInfo[playerid][pEarnings] += PlayerInfo[playerid][pHoldupAmount];
}
format(string, sizeof(string), "Attention All Units! %s Has Been Robbed By %s (%d).",PlayerInfo[playerid][pName],playerid,PlayerInfo[playerid][pHoldupVictim]);
SendClientMessageToTeam(TEAM_LAW,COLOR_DISPATCH, string);
format(string, sizeof(string), "~b~%s (%d) ~w~Has Robbed ~g~$%d ~w~From ~b~%s~w~.",PlayerInfo[playerid][pName],playerid,PlayerInfo[playerid][pHoldupAmount],PlayerInfo[playerid][pHoldupVictim]);
SendClientOnScreenTextToAll(string);
PlayerInfo[playerid][pHoldupAmount] = 0;
TextDrawHideForPlayer(playerid, StatsDisplay[playerid]);
}
}
case MISSION_TYPE_CASINO_ROBBERY_2:
{
if (GetPlayerState(playerid) == PLAYER_STATE_DRIVER && PLAYER_STATE_ONFOOT)
{
format(string, sizeof(string), "~w~CASINO ROBBERY COMPLETE~n~~y~ROBBED $%d",PlayerInfo[playerid][pHoldupAmount]);
GameTextForPlayer(playerid,string, 5000, 3);
ShowTextDrawMenu(playerid, TD_MENU_INFO,"~g~Casino Robbery", 6, 0);
format(string, sizeof(string), "~w~You Have Successfully Reached Your ~p~Hideout~n~~w~You Cracked The Safe And Found ~g~$%d~n~~w~You Have Evaded The ~b~Police~n~~w~Your ~r~Wanted Level ~w~Has Been Lowered",PlayerInfo[playerid][pHoldupAmount]);
ShowTextDrawMenuItems(playerid, 0, string, " ", " ",0);
PlayerPlaySound(playerid, 1058, 0.0, 0.0, 0.0);
DisablePlayerRaceCheckpoint(playerid);
PlayerInfo[playerid][pRaceCheckpoint] = 0;
PlayerInfo[playerid][pMission] = 0;
PlayerInfo[playerid][pHoldup] = 0;
if (PlayerInfo[playerid][pHoldupAmount] > 0)
{
GivePlayerMoney(playerid,PlayerInfo[playerid][pHoldupAmount]);
PlayerInfo[playerid][pEarnings] += PlayerInfo[playerid][pHoldupAmount];
}
format(string, sizeof(string), "Attention All Units! %s Has Been Robbed By %s (%d).",PlayerInfo[playerid][pName],playerid,PlayerInfo[playerid][pHoldupVictim]);
SendClientMessageToTeam(TEAM_LAW,COLOR_DISPATCH, string);
format(string, sizeof(string), "~b~%s (%d) ~w~Has Robbed ~g~$%d ~w~From ~b~%s~w~.",PlayerInfo[playerid][pName],playerid,PlayerInfo[playerid][pHoldupAmount],PlayerInfo[playerid][pHoldupVictim]);
SendClientOnScreenTextToAll(string);
PlayerInfo[playerid][pHoldupAmount] = 0;
TextDrawHideForPlayer(playerid, StatsDisplay[playerid]);
}
}
}
return 1;
}
here is it!