05.03.2011, 07:15
Hi i just want to do as in my other topic but now on cashboxmission. So i added a cashbox mission that when you enter cashbox checkpoint you must deliver it to somewhere else. But i don't want the TEAM_COP to enter that checkpoint and take it and a message to appear : you are a cop defend it. Here is my other topic https://sampforum.blast.hk/showthread.php?tid=234452
Here is my code :
Here is my code :
pawn Код:
public OnGameModeMission()
{ if(pdebug == 1){print("[DEBUG] OnGameModeMission()");}
new string[128];
if(MissionActive == 1)
{
if(PlayerIsDoingMission == INVALID_PLAYER_ID)
{
ResetMissions();
new rcashbox;
if(city == 1){rcashbox = random(sizeof(RandomFindCashbox_LS));}
RandomCashboxMissionMoney = MinCashboxMissionMoney+random(MaxCashboxMissionMoney-MinCashboxMissionMoney);
if(city == 1){format(string, sizeof(string), "** Mission: Cashbox **: Find the cashbox at %s! Worth: %d$", RandomFindCashboxName_LS[rcashbox][0], RandomCashboxMissionMoney);
SendClientMessageToAll(COLOR_YELLOW, string);
}
new Float:ratio = 4.0;
for(new i=0; i<MAX_SLOTS; i++)
{
if(city == 1){cashbox1 = SetPlayerCheckpoint(i, RandomFindCashbox_LS[rcashbox][0], RandomFindCashbox_LS[rcashbox][1], RandomFindCashbox_LS[rcashbox][2], ratio);}
}
if(city == 1){
CheckpointBusyX = RandomFindCashbox_LS[rcashbox][0];
CheckpointBusyY = RandomFindCashbox_LS[rcashbox][1];
CheckpointBusyZ = RandomFindCashbox_LS[rcashbox][2];
AllPlaySound(1139);
}
}
}