19.06.2014, 18:33
How can i enter in a race checkpoint As Driver state And On_foot state?
i've mad a robbery system with racecheckpoints when i enter in a vehicle and then if i get off from vehicle i can't pick the racecheckpoint!
and if again i enter in same vehicle i can enter in robbeyr*racecheckpoint .
*i can't complete robbery in other vehicle! and Onfoot!
MISSION!
OnPlayerEnterRaceCheckpoint
i've mad a robbery system with racecheckpoints when i enter in a vehicle and then if i get off from vehicle i can't pick the racecheckpoint!
and if again i enter in same vehicle i can enter in robbeyr*racecheckpoint .
*i can't complete robbery in other vehicle! and Onfoot!
MISSION!
PHP код:
forward OnPlayerMission();
public OnPlayerMission()
{
new string[256];
new RandomLv = random(sizeof(LvHideOutSpawns));
new RandomLs = random(sizeof(LsHideOutSpawns));
new RandomSf = random(sizeof(SfHideOutSpawns));
for(new i = 0; i < GetMaxPlayers(); i++)
{
if(IsPlayerConnected(i) && !IsPlayerNPC(i) && PlayerInfo[i][pSpawn] == 1)
{
switch (PlayerInfo[i][pMission])
{
case MISSION_TYPE_COURIER_2:
{
PlayerInfo[i][pMissionMinute] ++;
if (PlayerInfo[i][pMissionMinute] == 60)
{
PlayerInfo[i][pMissionMinute] = 0;
PlayerInfo[i][pMissionHour] ++;
}
if (PlayerInfo[i][pMissionHour] < 10)
format(string, sizeof(string), "~p~0%d",PlayerInfo[i][pMissionHour]);
else
format(string, sizeof(string), "~p~%d",PlayerInfo[i][pMissionHour]);
if (PlayerInfo[i][pMissionMinute] < 10)
format(string, sizeof(string), "~p~%s:0%d",string,PlayerInfo[i][pMissionMinute]);
else
format(string, sizeof(string), "~p~%s:%d",string,PlayerInfo[i][pMissionMinute]);
format(string, sizeof(string), "~b~Courier Mission~n~~w~- %s",string);
TextDrawSetString(StatsDisplay[i], string);
}
case MISSION_TYPE_TRUCK_2:
{
PlayerInfo[i][pMissionMinute] ++;
if (PlayerInfo[i][pMissionMinute] == 60)
{
PlayerInfo[i][pMissionMinute] = 0;
PlayerInfo[i][pMissionHour] ++;
}
if (PlayerInfo[i][pMissionHour] < 10)
format(string, sizeof(string), "~p~0%d",PlayerInfo[i][pMissionHour]);
else
format(string, sizeof(string), "~p~%d",PlayerInfo[i][pMissionHour]);
if (PlayerInfo[i][pMissionMinute] < 10)
format(string, sizeof(string), "~p~%s:0%d",string,PlayerInfo[i][pMissionMinute]);
else
format(string, sizeof(string), "~p~%s:%d",string,PlayerInfo[i][pMissionMinute]);
format(string, sizeof(string), "~b~Delivery Mission~n~~w~- %s",string);
TextDrawSetString(StatsDisplay[i], string);
}
case MISSION_TYPE_STORE_ROBBERY:
{
if (PlayerInfo[i][pHoldup] > 0)
{
PlayerInfo[i][pHoldup] --;
if (PlayerInfo[i][pHoldup] > 25)
{
GameTextForPlayer(i,"~w~ROBBERY IN PROGRESS~n~~y~OPENING CASH REGISTER", 5000, 3);
}
if (PlayerInfo[i][pHoldup] == 25 || PlayerInfo[i][pHoldup] == 20 || PlayerInfo[i][pHoldup] == 15 || PlayerInfo[i][pHoldup] == 10 || PlayerInfo[i][pHoldup] == 5)
{
PlayerInfo[i][pHoldupAmount] += random(1000) + random(1000) + random(1000) + random(1000);
}
if (PlayerInfo[i][pHoldup] > 1 && PlayerInfo[i][pHoldup] < 25)
{
format(string, sizeof(string), "~w~ROBBERY IN PROGRESS~n~~y~ROBBED $%d",PlayerInfo[i][pHoldupAmount]);
GameTextForPlayer(i,string, 5000, 3);
}
if (PlayerInfo[i][pHoldup] == 1)
{
DisablePlayerCheckpoint(HoldupCheckpoint[i]);
new Houseid = PlayerInfo[i][pLastOutSideID];
HouseData[Houseid][h_Robberies] ++;
HouseData[Houseid][h_RobWaitTime] = 60;
PlayerInfo[i][pHoldupWaitTime] = 60;
format(string, sizeof(string), "Attention All Units! %s Has Been Robbed By %s (%d).",PlayerInfo[i][pLocation],PlayerInfo[i][pName],i);
SendClientMessageToTeam(TEAM_LAW,COLOR_DISPATCH, string);
format(string, sizeof(string), "Holdup Complete. You Have Robbed $%d From The %s.",PlayerInfo[i][pHoldupAmount] ,HouseInfo[Houseid][h_HouseIntName]);
SendClientMessage(i, COLOR_SERVER_HELP_MSG, string);
format(string, sizeof(string), "~w~HOLDUP COMPLETE~n~~y~ROBBED $%d",PlayerInfo[i][pHoldupAmount]);
GameTextForPlayer(i,string, 5000, 3);
GivePlayerMoney(i, PlayerInfo[i][pHoldupAmount]);
PlayerInfo[i][pEarnings] += PlayerInfo[i][pHoldupAmount];
format(string, sizeof(string), "Crime: Robbery");
ReportCrimeTOPolice(i,string);
PlayerInfo[i][pMission] = 0;
PlayerInfo[i][pHoldup] = 0;
PlayerInfo[i][pHoldupAmount] = 0;
}
}
}// End of first case
case MISSION_TYPE_HOUSE_ROBBERY:
{
if (PlayerInfo[i][pHoldup] > 0)
{
PlayerInfo[i][pHoldup] --;
if (PlayerInfo[i][pHoldup] > 25)
{
GameTextForPlayer(i,"~w~ROBBERY IN PROGRESS~n~~y~STAY IN THE~n~~r~RED CHECKPOINT", 5000, 3);
}
if (PlayerInfo[i][pHoldup] == 25 || PlayerInfo[i][pHoldup] == 20 || PlayerInfo[i][pHoldup] == 15 || PlayerInfo[i][pHoldup] == 10 || PlayerInfo[i][pHoldup] == 5)
{
PlayerInfo[i][pHoldupAmount] += random(1000) + random(1000) + random(1000) + random(1000);
}
if (PlayerInfo[i][pHoldup] > 1 && PlayerInfo[i][pHoldup] < 25)
{
format(string, sizeof(string), "~w~ROBBERY IN PROGRESS~n~~y~ROBBED $%d",PlayerInfo[i][pHoldupAmount]);
GameTextForPlayer(i,string, 5000, 3);
}
if (PlayerInfo[i][pHoldup] == 1)
{
DisablePlayerCheckpoint(i);
new Houseid = PlayerInfo[i][pLastOutSideID];
HouseData[Houseid][h_Robberies] ++;
HouseData[Houseid][h_RobWaitTime] = 60;
PlayerInfo[i][pHoldupWaitTime] = 60;
format(string, sizeof(string), "Attention All Units! %s Has Been Robbed By %s (%d).",PlayerInfo[i][pLocation],PlayerInfo[i][pName],i);
SendClientMessageToTeam(TEAM_LAW,COLOR_DISPATCH, string);
format(string, sizeof(string), "Robbery Complete. You Have Robbed $%d From The %s.",PlayerInfo[i][pHoldupAmount] ,HouseInfo[Houseid][h_HouseIntName]);
SendClientMessage(i, COLOR_SERVER_HELP_MSG, string);
format(string, sizeof(string), "~w~ROBBERY COMPLETE~n~~y~ROBBED $%d",PlayerInfo[i][pHoldupAmount]);
GameTextForPlayer(i,string, 5000, 3);
GivePlayerMoney(i, PlayerInfo[i][pHoldupAmount]);
PlayerInfo[i][pEarnings] += PlayerInfo[i][pHoldupAmount];
format(string, sizeof(string), "Crime: Robbery");
ReportCrimeTOPolice(i,string);
PlayerInfo[i][pMission] = 0;
PlayerInfo[i][pHoldup] = 0;
PlayerInfo[i][pHoldupAmount] = 0;
}
}
}// End of second case
case MISSION_TYPE_ROBBERY:
{
if (PlayerInfo[i][pHoldup] > 0)
{
if (PlayerInfo[i][pHoldup] > 1)
{
PlayerInfo[i][pHoldup] --;
GameTextForPlayer(i,"~w~ROBBERY IN PROGRESS~n~~y~STAY IN THE~n~~r~RED CHECKPOINT", 5000, 3);
PlayerInfo[i][pHoldupAmount] += random(1000) + random(1000) + random(1000) + random(1000) + random(1000);
}
if (PlayerInfo[i][pHoldup] == 1)
{
new Houseid = PlayerInfo[i][pLastOutSideID];
HouseData[Houseid][h_Robberies] ++;
HouseData[Houseid][h_RobWaitTime] = 60;
PlayerInfo[i][pHoldupWaitTime] = 60;
format(string, sizeof(string), "Robbery Complete. You Have Robbed $%d From %s.",PlayerInfo[i][pHoldupAmount] ,HouseInfo[Houseid][h_HouseIntName]);
SendClientMessage(i, COLOR_SERVER_HELP_MSG, string);
format(string, sizeof(string), "~w~ROBBERY COMPLETE~n~~y~ROBBED $%d",PlayerInfo[i][pHoldupAmount]);
GameTextForPlayer(i,string, 5000, 3);
GivePlayerMoney(i, PlayerInfo[i][pHoldupAmount]);
PlayerInfo[i][pEarnings] += PlayerInfo[i][pHoldupAmount];
format(string, sizeof(string), "Crime: Robbery");
ReportCrimeTOPolice(i,string);
PlayerInfo[i][pMission] = 0;
PlayerInfo[i][pHoldup] = 0;
format(string, sizeof(string), "Attention All Units! %s Has Been Robbed By %s (%d).",HouseInfo[Houseid][h_HouseIntName],PlayerInfo[i][pName],i);
SendClientMessageToTeam(TEAM_LAW,COLOR_DISPATCH, string);
format(string, sizeof(string), "~b~%s (%d) ~w~Has Robbed ~g~$%d ~w~From ~b~%s~w~.",PlayerInfo[i][pName],i,PlayerInfo[i][pHoldupAmount],HouseInfo[Houseid][h_HouseIntName]);
SendClientOnScreenTextToAll(string);
PlayerInfo[i][pHoldupAmount] = 0;
}
}
}//End Of Robbery Mission Check
case MISSION_TYPE_CHURCH_ROBBERY:
{
if (PlayerInfo[i][pHoldup] > 0)
{
if (PlayerInfo[i][pHoldup] > 1)
{
PlayerInfo[i][pHoldup] --;
GameTextForPlayer(i,"~w~ROBBERY IN PROGRESS~n~~y~STAY IN THE~n~~r~RED CHECKPOINT", 5000, 3);
PlayerInfo[i][pHoldupAmount] += random(1000) + random(1000) + random(1000) + random(1000) + random(1000);
}
if (PlayerInfo[i][pHoldup] == 1)
{
new Houseid = PlayerInfo[i][pLastOutSideID];
HouseData[Houseid][h_Robberies] ++;
HouseData[Houseid][h_RobWaitTime] = 60;
PlayerInfo[i][pHoldupWaitTime] = 60;
format(string, sizeof(string), "Robbery Complete. You Have Robbed $%d From The Church Of CnR.",PlayerInfo[i][pHoldupAmount]);
SendClientMessage(i, COLOR_SERVER_HELP_MSG, string);
format(string, sizeof(string), "~w~ROBBERY COMPLETE~n~~y~ROBBED $%d",PlayerInfo[i][pHoldupAmount]);
GameTextForPlayer(i,string, 5000, 3);
GivePlayerMoney(i, PlayerInfo[i][pHoldupAmount]);
PlayerInfo[i][pEarnings] += PlayerInfo[i][pHoldupAmount];
format(string, sizeof(string), "Crime: Church Robbery");
ReportCrimeTOPolice(i,string);
PlayerInfo[i][pMission] = 0;
PlayerInfo[i][pHoldup] = 0;
format(string, sizeof(string), "Attention All Units! The CnR Church Has Been Robbed By %s (%d).",HouseInfo[Houseid][h_HouseIntName],PlayerInfo[i][pName],i);
SendClientMessageToTeam(TEAM_LAW,COLOR_DISPATCH, string);
format(string, sizeof(string), "~b~%s (%d) ~w~Has Robbed ~g~$%d ~w~From ~r~The Church Of CnR.",PlayerInfo[i][pName],i,PlayerInfo[i][pHoldupAmount]);
SendClientOnScreenTextToAll(string);
PlayerInfo[i][pHoldupAmount] = 0;
}
}
}//End Of Robbery Mission Check
case MISSION_TYPE_CASINO_ROBBERY_1:
{
if (PlayerInfo[i][pHoldup] > 0)
{
if (PlayerInfo[i][pHoldup] > 2)// && PlayerInfo[i][pHoldup] <= 70
{
PlayerInfo[i][pHoldup] --;
GameTextForPlayer(i,"~w~ROBBERY IN PROGRESS~n~~y~STAY IN THE~n~~r~RED CHECKPOINT", 5000, 3);
PlayerInfo[i][pHoldupAmount] += random(1000) + random(1000) + random(1000) + random(1000) + random(1000);
}
if (PlayerInfo[i][pHoldup] == 2)
{
new Houseid = PlayerInfo[i][pLastOutSideID];
HouseData[Houseid][h_Robberies] ++;
HouseData[Houseid][h_RobWaitTime] = 60;
PlayerInfo[i][pHoldupWaitTime] = 60;
format(string, sizeof(string), "The %s",HouseInfo[Houseid][h_HouseIntName]);
strmid(PlayerInfo[i][pHoldupVictim], string, 0, 128, 128);
switch (CURRENT_GAMEMODE)
{
case LOS_SANTOS:
{
SetPlayerRaceCheckpoint(i, 2, LsHideOutSpawns[RandomLs][0], LsHideOutSpawns[RandomLs][1], LsHideOutSpawns[RandomLs][2], 0.0, 0.0, 0.0,4);
PlayerInfo[i][pGPSX] = LsHideOutSpawns[RandomLs][0];
PlayerInfo[i][pGPSY] = LsHideOutSpawns[RandomLs][1];
PlayerInfo[i][pGPSZ] = LsHideOutSpawns[RandomLs][2];
PlayerInfo[i][pGPS] = 1;
}
case LAS_VENTURAS:
{
SetPlayerRaceCheckpoint(i, 2, LvHideOutSpawns[RandomLv][0], LvHideOutSpawns[RandomLv][1], LvHideOutSpawns[RandomLv][2], 0.0, 0.0, 0.0,4);
PlayerInfo[i][pGPSX] = LvHideOutSpawns[RandomLv][0];
PlayerInfo[i][pGPSY] = LvHideOutSpawns[RandomLv][1];
PlayerInfo[i][pGPSZ] = LvHideOutSpawns[RandomLv][2];
PlayerInfo[i][pGPS] = 1;
}
case SAN_FIERRO:
{
SetPlayerRaceCheckpoint(i, 2, SfHideOutSpawns[RandomSf][0], SfHideOutSpawns[RandomSf][1], SfHideOutSpawns[RandomSf][2], 0.0, 0.0, 0.0,4);
PlayerInfo[i][pGPSX] = SfHideOutSpawns[RandomSf][0];
PlayerInfo[i][pGPSY] = SfHideOutSpawns[RandomSf][1];
PlayerInfo[i][pGPSZ] = SfHideOutSpawns[RandomSf][2];
PlayerInfo[i][pGPS] = 1;
}
}
GameTextForPlayer(i,"~y~BRING THE SAFE TO THE~n~~r~RED CHECKPOINT", 5000, 3);
ShowTextDrawMenu(i, TD_MENU_INFO,"~g~Casino Robbery", 8, 0);
format(string, sizeof(string), "~w~You Have Successfully Robbed The Safe~n~From ~p~%s~n~~w~Bring The Safe To Your Hideout In ~p~%s~n~Enter The ~r~Checkpoint ~w~To Collect The Money~n~~w~You Have ~g~4 Hours ~w~To Reach Your Hideout",PlayerInfo[i][pHoldupVictim],PlayerInfo[i][pHideout]);//~n~~w~Loose The ~b~Police ~w~To Lower Your Wanted Level~n~~w~Press ~y~2 ~w~For Robbery Information
ShowTextDrawMenuItems(i, 0, string, " ", " ",0);
TextDrawSetString(StatsDisplay[i], "~b~Casino Robbery~n~~g~Get To Hideout");
TextDrawShowForPlayer(i, StatsDisplay[i]);
PlayerInfo[i][pHoldupHour] = 4;
PlayerInfo[i][pHoldupMinute] = 0;
PlayerInfo[i][pHoldup] = 1;
PlayerInfo[i][pMission] = MISSION_TYPE_CASINO_ROBBERY_2;
}
}
}//End Of Casino Mission Check
case MISSION_TYPE_CASINO_ROBBERY_2:
{
if (PlayerInfo[i][pHoldup] == 1)
{
if (PlayerInfo[i][pHoldupHour] >= 0 && PlayerInfo[i][pHoldupMinute] > 0)
{
PlayerInfo[i][pHoldupMinute] --;
}
if (PlayerInfo[i][pHoldupHour] > 0 && PlayerInfo[i][pHoldupMinute] == 0)
{
PlayerInfo[i][pHoldupHour] --;
PlayerInfo[i][pHoldupMinute] = 59;
}
if (PlayerInfo[i][pHoldupHour] == 0 && PlayerInfo[i][pHoldupMinute] == 1)
{
GameTextForPlayer(i,"MISSION FAILED", 5000, 3);
SendClientMessage(i,COLOR_SERVER_HELP_MSG, "Casino Robbery Failed");
PlayerInfo[i][pHoldup] = 0;
PlayerInfo[i][pHoldupHour] = 0;
PlayerInfo[i][pHoldupMinute] = 0;
PlayerInfo[i][pHoldupAmount] = 0;
PlayerInfo[i][pMission] = 0;
PlayerInfo[i][pRaceCheckpoint] = 0;
DisablePlayerRaceCheckpoint(i);
TextDrawHideForPlayer(i, StatsDisplay[i]);
}
}
}
case MISSION_TYPE_BANK_ROBBERY_1:
{
if (PlayerInfo[i][pHoldup] > 0)
{
/*if (PlayerInfo[i][pHoldup] > 70)
{
GameTextForPlayer(i,"~w~ROBBERY IN PROGRESS~n~~y~STAY IN THE~n~~r~RED CHECKPOINT", 5000, 3);
}//OPENING SAFE
if (PlayerInfo[i][pHoldup] == 70 || PlayerInfo[i][pHoldup] == 65 || PlayerInfo[i][pHoldup] == 60 || PlayerInfo[i][pHoldup] == 55 || PlayerInfo[i][pHoldup] == 50 || PlayerInfo[i][pHoldup] == 45
|| PlayerInfo[i][pHoldup] == 40 || PlayerInfo[i][pHoldup] == 35 || PlayerInfo[i][pHoldup] == 30 || PlayerInfo[i][pHoldup] == 25 || PlayerInfo[i][pHoldup] == 20 || PlayerInfo[i][pHoldup] == 15 || PlayerInfo[i][pHoldup] == 10 || PlayerInfo[i][pHoldup] == 5)
{
PlayerInfo[i][pHoldupAmount] += RobberyCash;
}*/
if (PlayerInfo[i][pHoldup] > 2)// && PlayerInfo[i][pHoldup] <= 70
{
PlayerInfo[i][pHoldup] --;
GameTextForPlayer(i,"~w~ROBBERY IN PROGRESS~n~~y~STAY IN THE~n~~r~RED CHECKPOINT", 5000, 3);
PlayerInfo[i][pHoldupAmount] += RobberyCash;
}
if (PlayerInfo[i][pHoldup] == 2)
{
new Houseid = PlayerInfo[i][pLastOutSideID];
HouseData[Houseid][h_Robberies] ++;
HouseData[Houseid][h_RobWaitTime] = 60;
PlayerInfo[i][pHoldupWaitTime] = 60;
format(string, sizeof(string), "%s",HouseInfo[Houseid][h_HouseIntName]);
strmid(PlayerInfo[i][pHoldupVictim], string, 0, 128, 128);
switch (CURRENT_GAMEMODE)
{
case LOS_SANTOS:
{
SetPlayerRaceCheckpoint(i, 2, LsHideOutSpawns[RandomLs][0], LsHideOutSpawns[RandomLs][1], LsHideOutSpawns[RandomLs][2], 0.0, 0.0, 0.0,4);
PlayerInfo[i][pGPSX] = LsHideOutSpawns[RandomLs][0];
PlayerInfo[i][pGPSY] = LsHideOutSpawns[RandomLs][1];
PlayerInfo[i][pGPSZ] = LsHideOutSpawns[RandomLs][2];
PlayerInfo[i][pGPS] = 1;
}
case LAS_VENTURAS:
{
SetPlayerRaceCheckpoint(i, 2, LvHideOutSpawns[RandomLv][0], LvHideOutSpawns[RandomLv][1], LvHideOutSpawns[RandomLv][2], 0.0, 0.0, 0.0,4);
PlayerInfo[i][pGPSX] = LvHideOutSpawns[RandomLv][0];
PlayerInfo[i][pGPSY] = LvHideOutSpawns[RandomLv][1];
PlayerInfo[i][pGPSZ] = LvHideOutSpawns[RandomLv][2];
PlayerInfo[i][pGPS] = 1;
}
case SAN_FIERRO:
{
SetPlayerRaceCheckpoint(i, 2, SfHideOutSpawns[RandomSf][0], SfHideOutSpawns[RandomSf][1], SfHideOutSpawns[RandomSf][2], 0.0, 0.0, 0.0,4);
PlayerInfo[i][pGPSX] = SfHideOutSpawns[RandomSf][0];
PlayerInfo[i][pGPSY] = SfHideOutSpawns[RandomSf][1];
PlayerInfo[i][pGPSZ] = SfHideOutSpawns[RandomSf][2];
PlayerInfo[i][pGPS] = 1;
}
}
GameTextForPlayer(i,"~y~BRING THE SAFE TO THE~n~~r~RED CHECKPOINT", 5000, 3);
ShowTextDrawMenu(i, TD_MENU_INFO,"~g~Bank Robbery", 8, 0);
format(string, sizeof(string), "~w~You Have Successfully Robbed The Safe~n~From ~p~%s~n~~w~Bring The Safe To Your Hideout In ~p~%s~n~Enter The ~r~Checkpoint ~w~To Collect The Money~n~~w~You Have ~g~4 Hours ~w~To Reach Your Hideout",PlayerInfo[i][pHoldupVictim],PlayerInfo[i][pHideout]);//~n~~w~Loose The ~b~Police ~w~To Lower Your Wanted Level~n~~w~Press ~y~2 ~w~For Robbery Information
ShowTextDrawMenuItems(i, 0, string, " ", " ",0);
TextDrawSetString(StatsDisplay[i], "~b~Bank Robbery~n~~g~Get To Hideout");
TextDrawShowForPlayer(i, StatsDisplay[i]);
format(string, sizeof(string), "Crime: Robbery");
ReportCrimeTOPolice(i,string);
PlayerInfo[i][pHoldupHour] = 4;
PlayerInfo[i][pHoldupMinute] = 0;
PlayerInfo[i][pHoldup] = 1;
PlayerInfo[i][pMission] = MISSION_TYPE_BANK_ROBBERY_2;
}
}
}//End Of Bank Mission Check
case MISSION_TYPE_BANK_ROBBERY_2:
{
if (PlayerInfo[i][pHoldup] == 1)
{
if (PlayerInfo[i][pHoldupHour] >= 0 && PlayerInfo[i][pHoldupMinute] > 0)
{
PlayerInfo[i][pHoldupMinute] --;
}
if (PlayerInfo[i][pHoldupHour] > 0 && PlayerInfo[i][pHoldupMinute] == 0)
{
PlayerInfo[i][pHoldupHour] --;
PlayerInfo[i][pHoldupMinute] = 59;
}
if (PlayerInfo[i][pHoldupHour] == 0 && PlayerInfo[i][pHoldupMinute] == 1)
{
GameTextForPlayer(i,"MISSION FAILED", 5000, 3);
SendClientMessage(i,COLOR_SERVER_HELP_MSG, "Bank Robbery Failed");
PlayerInfo[i][pHoldup] = 0;
PlayerInfo[i][pHoldupHour] = 0;
PlayerInfo[i][pHoldupMinute] = 0;
PlayerInfo[i][pHoldupAmount] = 0;
PlayerInfo[i][pMission] = 0;
PlayerInfo[i][pRaceCheckpoint] = 0;
DisablePlayerRaceCheckpoint(i);
TextDrawHideForPlayer(i, StatsDisplay[i]);
}
}
}//End Of Bank Mission Check
}//End Of Switch
}
}
}
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:
{
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:
{
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;
}