PHP код:
forward OnPlayerMission();
public OnPlayerMission()
{
new string[256];
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 ~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 ~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(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_CASINO_ROBBERY_1:
{
if (PlayerInfo[i][pHoldup] > 0)
{
if (PlayerInfo[i][pHoldup] > 2)// && PlayerInfo[i][pHoldup] <= 70
{
PlayerInfo[i][pHoldup] --;
//format(string, sizeof(string), "~w~ROBBERY IN PROGRESS~n~~y~ROBBED $%d",PlayerInfo[i][pHoldupAmount]);
//GameTextForPlayer(i,string, 5000, 3);
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, 1105.455688, -306.720001, 73.992187, 0.0, 0.0, 0.0,4);//Robbery Hide Out in Hilltop Farm
strmid(PlayerInfo[i][pHideout], "Hilltop Farm", 0, 256, 256);
PlayerInfo[i][pGPSX] = 1105.455688;
PlayerInfo[i][pGPSY] = -306.720001;
PlayerInfo[i][pGPSZ] = 73.992187;
PlayerInfo[i][pGPS] = 1;
}
case LAS_VENTURAS:
{
SetPlayerRaceCheckpoint(i, 2, -154.040054, 2727.959228, 61.906562, 0.0, 0.0, 0.0,4);//Robbery Hide Out in Las Payasadas
strmid(PlayerInfo[i][pHideout], "Las Payasadas", 0, 256, 256);
PlayerInfo[i][pGPSX] = -154.040054;
PlayerInfo[i][pGPSY] = 2727.959228;
PlayerInfo[i][pGPSZ] = 61.906562;
PlayerInfo[i][pGPS] = 1;
}
case SAN_FIERRO:
{
SetPlayerRaceCheckpoint(i, 2,-2078.076660, -2555.937988, 30.421875, 0.0, 0.0, 0.0,4);//Robbery Hide Out in Angel Pine
strmid(PlayerInfo[i][pHideout], "Angel Pine", 0, 256, 256);
PlayerInfo[i][pGPSX] = -2078.076660;
PlayerInfo[i][pGPSY] = -2555.937988;
PlayerInfo[i][pGPSZ] = 30.421875;
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]);
}
}
}//End Of Casino Mission Check
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, 1105.455688, -306.720001, 73.992187, 0.0, 0.0, 0.0,4);//Robbery Hide Out in Hilltop Farm
strmid(PlayerInfo[i][pHideout], "Hilltop Farm", 0, 256, 256);
PlayerInfo[i][pGPSX] = 1105.455688;
PlayerInfo[i][pGPSY] = -306.720001;
PlayerInfo[i][pGPSZ] = 73.992187;
PlayerInfo[i][pGPS] = 1;
}
case LAS_VENTURAS:
{
SetPlayerRaceCheckpoint(i, 2, -154.040054, 2727.959228, 61.906562, 0.0, 0.0, 0.0,4);//Robbery Hide Out in Las Payasadas
strmid(PlayerInfo[i][pHideout], "Las Payasadas", 0, 256, 256);
PlayerInfo[i][pGPSX] = -154.040054;
PlayerInfo[i][pGPSY] = 2727.959228;
PlayerInfo[i][pGPSZ] = 61.906562;
PlayerInfo[i][pGPS] = 1;
}
case SAN_FIERRO:
{
SetPlayerRaceCheckpoint(i, 2,-2078.076660, -2555.937988, 30.421875, 0.0, 0.0, 0.0,4);//Robbery Hide Out in Angel Pine
strmid(PlayerInfo[i][pHideout], "Angel Pine", 0, 256, 256);
PlayerInfo[i][pGPSX] = -2078.076660;
PlayerInfo[i][pGPSY] = -2555.937988;
PlayerInfo[i][pGPSZ] = 30.421875;
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
}
}
}