[HELP] KillTimer
#1

I have a errror with KillTimer.. I need to fix it urgently.

This is the code..

Code:
KillTimer(JobCash);
And error..

Code:
C:\Archivos de programa\Rockstar Games\GTA San Andreas\SA-MP 0.3b\Server 0.3b\gamemodes\fierroharb_retardjob.pwn(1418) : error 076: syntax error in the expression, or invalid function call
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Its only that line, the rest everything working :l
It's urgent please help.. :l
Reply
#2

Check if the SetTimer variable is like:

pawn Code:
synctimer = SetTimer("SyncUp", 5000, 1); //SyncyUp is a callback (public)
If yes, you can use KillTimer like this:

pawn Code:
KillTimer(synctimer);

If not, put your JobCash settimer here in the topic.


I hope that i have helped
Reply
#3

Not working :S Its urgent, here is my script
Up of all..
Code:
forward JobCash(playerid);
In a callback..
Code:
JobCash = SetTimerEx("CashJob",5000,true,"i",playerid);
In another callback
Code:
KillTimer(JobCash);  // Here is the error
Reply
#4

pawn Code:
forward JobCash();

public JobCash()
{
     Info......
    return 1;
}
Only use (playerid); If public JobCash, involves "SomeThingHere(Playerid);"
Reply
#5

Code:
public JobCash(playerid)
{
    Cashout[playerid] = -100;
    return 1;
}
(playerid) is involved...
Reply
#6

kkkkkkkkk hey dude, look at this:

Code:
JobCash = SetTimerEx("CashJob",5000,true,"i",playerid);


public JobCash(playerid)
{
    Cashout[playerid] = -100;
    return 1;
}
Can you see the problem ?
Reply
#7

There is no error... i just show you its using playerid
The error is at


KillTimer(JobCash);
Reply
#8

His point is, you have CashJob, and JobCash.
They need to be the same(I didn't even notice that mistake xD)
Reply
#9

Sorry for the joke man, look:


CashJob = The name of the public function.

JobCash = The name of the settimer variable.


Code:
JobCash = SetTimerEx("CashJob",5000,true,"i",playerid);
So, you put JobCash like public function, but JobCash is the name of the settimer variable ! The name of public function is CashJob xD


To solve your problem, use it:


pawn Code:
KillTimer(JobCash);

JobCash = SetTimerEx("CashJob",5000,true,"i",playerid);

forward CashJob(playerid);
public CashJob(playerid)
{
    Cashout[playerid] = -100;
    return 1;
}

Sorry, i hope that i have helped
Reply
#10

FIXED!! Thank you very much!!!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)