DestroyFire Object Problem
#10

So you PMed me your code. ill display the main code here.

PHP код:
public RandFireTimer(playerid)
{
    new 
random(56),string[128];
     
FireObject CreateObject(18691HouseInfo[a][hEntrancex],HouseInfo[a][hEntrancey],HouseInfo[a][hEntrancez],0,0,0);
    foreach(
Playeri)
    {
        if(
Isparamedic(i))
        {
            
SendClientMessage(iCOLOR_LIGHTRED"---Fire Dispatch ---");
             
format(stringsizeof(string), "Fire Was Seen at %s`s House.",HouseInfo[a][hOwner]);
             
SendClientMessage(i,COLOR_LIGHTREDstring);
             
SendClientMessage(i,COLOR_LIGHTRED"Please Fire Fighters Respond to the call.");
            
SetPlayerCheckpoint(iHouseInfo[a][hEntrancex],HouseInfo[a][hEntrancey],HouseInfo[a][hEntrancez],5);
            
CP[i] = 1RespondedToFire[i] = 1;
        }
       }
       return 
1;
}
public 
PuttingOutFire(playerid)
{
    if(
RespondedToFire[playerid] == 1)
    {
        new 
random(56);
        
DestroyObject(FireObject[playerid]);
        if(
IsPlayerInRangeOfPoint(playerid4,HouseInfo[a][hEntrancex],HouseInfo[a][hEntrancey],HouseInfo[a][hEntrancez])) return SendClientMessage(playerid,COLOR_LIGHTRED"You have Extingushed the Fire.");
        
DisablePlayerCheckpoint(playerid);
        
RespondedToFire[playerid] = 0;
        
SetTimer("RandFireTimer",200000,false);
    }
     return 
1;

There are a Few Mistakes in your above code and a few Declaration problems causing that.
Follow these steps:

1> Idk what is MAX_FIRES you defined at the top. if it was for Fire System, remove it, its of no use.

2> Again. RandFireTimer is not a Playerid based variable. so instead of.
Код:
 forward RandFireTimer(playerid);
Use
Код:
forward RandFireTimer();
Also remove playerid from Public callback too.

3>FireObject is not a Playerid based Object. Use new FireObject instead of new FireObject[playerid].
remove [playerid] along with FireObject Where ever you used it.


4>Remove
Код:
if(IsPlayerInRangeOfPoint(playerid, 4,HouseInfo[a][hEntrancex],HouseInfo[a][hEntrancey],HouseInfo[a][hEntrancez])) return SendClientMessage(playerid,COLOR_LIGHTRED, "You have Extingushed the Fire.");
from PuttingOutFire Public. its of no use. Because a's value will not be same as in RandFireTimer.

5>Set Timer RandFireTimer repeat to false instead of True in PuttingOutFire Public and OnGameModeInit.
Код:
SetTimer("RandFireTimer",200000,false);
6> You have to return 1 after your body ends in OnPlayerStateChange.
Код:
 if(RespondedToFire[playerid] == 1 && IsAtFire[playerid] == 1)
		{
			FireTimer[playerid] = SetTimerEx("PuttingOutFire",20000, true, "i",playerid);
                        return 1;		
                }
I Hope your Problems will be fixed now.
Reply


Messages In This Thread
DestroyFire Object Problem - by MrTea - 14.05.2017, 15:53
Re: DestroyFire Object Problem - by Morpheus1992 - 14.05.2017, 16:09
Re: DestroyFire Object Problem - by MrTea - 14.05.2017, 18:05
Re: DestroyFire Object Problem - by MrTea - 15.05.2017, 13:33
Re: DestroyFire Object Problem - by iLearner - 15.05.2017, 13:36
Re: DestroyFire Object Problem - by MrTea - 15.05.2017, 14:46
Re: DestroyFire Object Problem - by GTLS - 15.05.2017, 16:31
Re: DestroyFire Object Problem - by MrTea - 16.05.2017, 15:26
Re: DestroyFire Object Problem - by GTLS - 16.05.2017, 18:13
Re: DestroyFire Object Problem - by GTLS - 17.05.2017, 10:01

Forum Jump:


Users browsing this thread: 3 Guest(s)