Giving Money to all fireman
#7

pawn Код:
public f_OnPlayerUpdate(playerid)
{
for(new a = 0; a < MAX_PLAYERS; a++)
{
if(pInfo[a][pMission] == 1)
{
new newkeys,l,u;
GetPlayerKeys(a, newkeys, l, u);
new i;
if(Holding(KEY_FIRE))
{
if(GetPlayerWeapon(a) == 42)
{
for(i = 0; i<MaxFire; i++)
{
if(IsValidFire(i))
{
if(PlayerFaces(a, FirePos[i][0],  FirePos[i][1],  FirePos[i][2], 1) && IsPlayerInRangeOfPoint(playerid, 4, FirePos[i][0],  FirePos[i][1],  FirePos[i][2]))
{

FireHealth[i]-=1;
#if defined Labels
new string[128];
format(string, sizeof(string), "Fire Source\n%d/%d", FireHealth[i], FireHealthMax[i]);
Update3DTextLabelText(FireText[i], 0x49E843FF, string);
//Delete3DTextLabel(FireText[i]);
//FireText[i] = Create3DTextLabel(string, 0xFFFFFFFF, FirePos[i][0],  FirePos[i][1],  FirePos[i][2], 20, 0);
#endif
if(FireHealth[i] <= 0)
{
new randa = randal(200, 350);
DeleteFire(i);
CallRemoteFunction("OnFireKill", "dd", i, a);
SendClientMessage(a,COLOR_LAWNGREEN,"You have extinguished a fire source");
GivePlayerMoney(a,randa);
format(string,sizeof(string),"No. Of Fire Sources: %d",TotalFires);
TextDrawSetString(Text:Textdraw1,string);
if(IsPlayerInRangeOfPoint(a, 4.0, FirePos[i][0],  FirePos[i][1],  FirePos[i][2]))
{
new mo = randal(3000, 3500);
GivePlayerMoney(a,mo);
}
}
if(TotalFires == 0)
{

SendClientMessage(a, COLOR_LAWNGREEN, "Mission Over");
mission = 0;
if(mission == 0)
{
TextDrawHideForPlayer(a, Textdraw0);
TextDrawHideForPlayer(a, Textdraw1);
TextDrawHideForPlayer(a, Textdraw3);
}
}
}
}
}
}
}
}
}
return 1;
}
Test this
Reply


Messages In This Thread
Giving Money to all fireman - by ZBits - 05.02.2014, 15:25
Re: Giving Money to all fireman - by SickAttack - 06.02.2014, 04:27
Re: Giving Money to all fireman - by Don_Cage - 06.02.2014, 08:35
Re: Giving Money to all fireman - by ZBits - 06.02.2014, 19:24
Re: Giving Money to all fireman - by ZBits - 06.02.2014, 23:05
Re: Giving Money to all fireman - by ZBits - 07.02.2014, 18:26
Re: Giving Money to all fireman - by Golimad - 07.02.2014, 19:40
Re: Giving Money to all fireman - by ZBits - 08.02.2014, 02:51
Re: Giving Money to all fireman - by KoczkaHUN - 08.02.2014, 10:03
Re: Giving Money to all fireman - by ZBits - 08.02.2014, 11:49

Forum Jump:


Users browsing this thread: 1 Guest(s)