Timer Started But Function Is Not Called?
#1

I do receive warnings and it does not function properly. I do notice that when i connect it does add to the FireManCount and it does start the timer but. The function does not execute.
Warnings
Код:
C:\Users\HCC\Desktop\Linux-Server\gamemodes\vx-rp.pwn(5327) : warning 204: symbol is assigned a value that is never used: "Timer"
C:\Users\HCC\Desktop\Linux-Server\gamemodes\vx-rp.pwn(5327 -- 17732) : warning 203: symbol is never used: "randomSpawns"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Warnings.
Bool And Grouping
pawn Код:
new Timer,FireManCount,bool:TimerStarted = false;
new randomSpawns[][][3] =
{
    { {1535.6497,-1679.7516,13.3828}, {1535.6281,-1684.0664,13.5469}, {1535.6559,-1689.5146,13.5469}, {1535.5216,-1696.2633,13.5469} },  // fire 1
    { {1698.7971,1435.2810,10.7149}, {1702.1265,1432.8711,10.6901}, {1703.1891,1426.2205,10.6406}, {1703.6338,1420.9512,10.6484} },   // fire 2
    { {1172.3600,-1323.3131,15.4029}, {1175.4486,-1325.5078,14.3906}, {1178.7393,-1326.0090,14.1349}, {1182.5364,-1327.6281,13.5824} }   //fire 3
};
OnPlayerSpawn
pawn Код:
public OnPlayerSpawn(playerid) {
    if(groupVariables[playerVariables[playerid][pGroup]][gGroupType] != 4)
        {
        FireManCount++;
        if(TimerStarted == false)
        {
        Timer = SetTimer("RandomFireTimer",5000,true); // Repeats a timer of 5 seconds
        }
        return 1;
        }
The Function
pawn Код:
public RandomFireTimer
{
    if(FireManCount == 0)
    {
        TimerStarted = false;
        KillTimer(Timer);
    }
    new rndfire = random(sizeof(randomSpawns));
    AddFire(randomSpawns[rndfire][0], randomSpawns[rndfire][1], randomSpawns[rndfire][2]);
    printf("Fire Spawn");
        if(groupVariables[playerVariables[playerid][pGroup]][gGroupType] != 4)
        {
            SendClientMessage(playerid,Color_White,"FireSpawned");
        }
    return 1;
}
Reply
#2

pawn Код:
Timer = SetTimer("RandomFireTimer",5000,true);
To
pawn Код:
SetTimer("RandomFireTimer",5000,true);
Reply
#3

pawn Код:
public RandomFireTimer
to
pawn Код:
public RandomFireTimer()
Reply
#4

Quote:
Originally Posted by FuTuяe
Посмотреть сообщение
pawn Код:
public RandomFireTimer
to
pawn Код:
public RandomFireTimer()
I did change that no effect.

Quote:
Originally Posted by T0pAz
Посмотреть сообщение
pawn Код:
Timer = SetTimer("RandomFireTimer",5000,true);
To
pawn Код:
SetTimer("RandomFireTimer",5000,true);
I did what you said but that would defeat the purpose of part of the system, also i do notice that the timer does start it is something to do with the function. Though I did do what you said and it returned
Код:
C:\Users\HCC\Desktop\Linux-Server\gamemodes\vx-rp.pwn(17734) : warning 203: symbol is never used: "Timer"
C:\Users\HCC\Desktop\Linux-Server\gamemodes\vx-rp.pwn(17734) : warning 203: symbol is never used: "randomSpawns"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Warnings.
Reply
#5

[[Sorry Meant To Edit Post Above, My Mistake]

Edit: Changed the function same warnings
pawn Код:
public RandomFireTimer ()
{
    if(FireManCount == 0)
    {
        TimerStarted = false;
        KillTimer(Timer);
    return 1;
    }
    if(FireManCount == 1+)
    {
    new rndfire = random(sizeof(randomSpawns));
    AddFire(randomSpawns[rndfire][0], randomSpawns[rndfire][1], randomSpawns[rndfire][2]);
    printf("Fire Spawn");
        if(groupVariables[playerVariables[playerid][pGroup]][gGroupType] != 4)
        {
            SendClientMessage(playerid,Color_White,"FireSpawned");
        }
        return 1;
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)