I need help with Race Checkpoint!
#3

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" "0128128);
        }
        }
        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(playeridTD_MENU_INFO,"~b~Courier Mission"100);
            
//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(stringsizeof(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(playerid0string" "" ",0);
            
format(stringsizeof(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(playeridMenu_StatsCont[playerid]);
            
PlayerInfo[playerid][pWantedLevel] = 6;
            
format(stringsizeof(string), "Crime: Smuggling Illegal Items");
            
ReportCrimeTOPolice(playerid,string);
            
SetPlayerWantedStats(playerid,"Smuggling Illegal Items");
            
SetPlayerRaceCheckpoint(playerid2CourierMissionInfo[Mission][cm_del_cp_x],CourierMissionInfo[Mission][cm_del_cp_y],CourierMissionInfo[Mission][cm_del_cp_z], 0,0,04);
            
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(playeridTD_MENU_INFO,"~b~Delivery Complete"50);
            
format(stringsizeof(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(playerid0string" "" ",0);
            
format(stringsizeof(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(playerid10580.00.00.0);
            
DisablePlayerRaceCheckpoint(playerid);
            
PlayerInfo[playerid][pMission] = 0;
            
PlayerInfo[playerid][pRaceCheckpoint] = 0;
            
GivePlayerMoney(playerid,5000);
            
PlayerInfo[playerid][pEarnings] += 5000;
            
TextDrawHideForPlayer(playeridStatsDisplay[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(playeridTD_MENU_INFO,"~b~Truck Delivery"70);
            
//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(stringsizeof(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(playerid0string" "" ",0);
            
format(stringsizeof(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(playeridMenu_StatsCont[playerid]);
            
//PlayerInfo[playerid][pWantedLevel] = 6;
            //format(string, sizeof(string), "Crime: Smuggling Illegal Items");
            //ReportCrimeTOPolice(playerid,string);
            //SetPlayerWantedStats(playerid,"Smuggling Illegal Items");
            
SetPlayerRaceCheckpoint(playerid2TruckMissionInfo[Mission][tm_del_cp_x],TruckMissionInfo[Mission][tm_del_cp_y],TruckMissionInfo[Mission][tm_del_cp_z], 0,0,04);
            
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(playeridTD_MENU_INFO,"~b~Delivery Complete"70);
            
format(stringsizeof(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(playerid0string" "" ",0);
            
format(stringsizeof(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(playerid10580.00.00.0);
            
DisablePlayerRaceCheckpoint(playerid);
            
PlayerInfo[playerid][pMission] = 0;
            
PlayerInfo[playerid][pRaceCheckpoint] = 0;
            
GivePlayerMoney(playerid,5000);
            
PlayerInfo[playerid][pEarnings] += 5000;
            
TextDrawHideForPlayer(playeridStatsDisplay[playerid]);
            }
        }
        case 
MISSION_TYPE_BANK_ROBBERY_2:
        {
            if (
GetPlayerState(playerid) == PLAYER_STATE_DRIVER && PLAYER_STATE_ONFOOT)
            {
            
format(stringsizeof(string), "~w~BANK ROBBERY COMPLETE~n~~y~ROBBED $%d",PlayerInfo[playerid][pHoldupAmount]);
            
GameTextForPlayer(playerid,string50003);
             
ShowTextDrawMenu(playeridTD_MENU_INFO,"~g~Bank Robbery"60);
            
format(stringsizeof(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(playerid0string" "" ",0);
            
PlayerPlaySound(playerid10580.00.00.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(stringsizeof(string), "Attention All Units!  %s Has Been Robbed By %s (%d).",PlayerInfo[playerid][pName],playerid,PlayerInfo[playerid][pHoldupVictim]);
            
SendClientMessageToTeam(TEAM_LAW,COLOR_DISPATCHstring);
            
format(stringsizeof(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(playeridStatsDisplay[playerid]);
            }
        }
        case 
MISSION_TYPE_CASINO_ROBBERY_2:
        {
            if (
GetPlayerState(playerid) == PLAYER_STATE_DRIVER && PLAYER_STATE_ONFOOT)
            {
            
format(stringsizeof(string), "~w~CASINO ROBBERY COMPLETE~n~~y~ROBBED $%d",PlayerInfo[playerid][pHoldupAmount]);
            
GameTextForPlayer(playerid,string50003);
             
ShowTextDrawMenu(playeridTD_MENU_INFO,"~g~Casino Robbery"60);
            
format(stringsizeof(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(playerid0string" "" ",0);
            
PlayerPlaySound(playerid10580.00.00.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(stringsizeof(string), "Attention All Units!  %s Has Been Robbed By %s (%d).",PlayerInfo[playerid][pName],playerid,PlayerInfo[playerid][pHoldupVictim]);
            
SendClientMessageToTeam(TEAM_LAW,COLOR_DISPATCHstring);
            
format(stringsizeof(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(playeridStatsDisplay[playerid]);
            }
        }
    }
    return 
1;
}
here is it
Reply


Messages In This Thread
I need help with Race Checkpoint! - by danish007 - 13.06.2014, 23:29
Re: I need help with Race Checkpoint! - by youssefehab500 - 13.06.2014, 23:36
Re: I need help with Race Checkpoint! - by danish007 - 14.06.2014, 18:49
Re: I need help with Race Checkpoint! - by danish007 - 14.06.2014, 19:56
Re: I need help with Race Checkpoint! - by danish007 - 15.06.2014, 13:21
Re: I need help with Race Checkpoint! - by danish007 - 16.06.2014, 16:38

Forum Jump:


Users browsing this thread: 2 Guest(s)