SA-MP Forums Archive
Problem with timer - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Problem with timer (/showthread.php?tid=391122)



Problem with timer - davve95 - 09.11.2012

Hi!


I tired to make a timer but I get a error, I want it to give money when it pass 0

pawn Код:
public robc()  //(robc is my timer name...)
{
    GivePlayerMoney(playerid,9000);
}
But I get error:

Код:
C:\Users\Davve\Desktop\Scripting\Server Las Venturas TDM\LV.pwn(847) : error 017: undefined symbol "playerid"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
(At that line)

The rest of the code:

pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
    SetTimer("robc",5000,false);
    return 1;
}
When the timer will start..

And on top of my script (forward)

pawn Код:
forward robc();
I had almost the same but on a filterscript but then I had so the timer started by a command
and it got a explode... And that workt with that...

Edit: Maybe it not work under there ?.. But I need it when it pass 0...


Re: Problem with timer - doreto - 09.11.2012

pawn Код:
forward robc(playerid);
public robc(playerid)  //(robc is my timer name...)
{
    GivePlayerMoney(playerid,9000);
}



Re: Problem with timer - Glad2BeHere - 09.11.2012

pawn Код:
forward robc(playerid);

public robc(playerid)
{
GivePlayerMoney(playerid,9000);
return 1;
}



Re: Problem with timer - Glad2BeHere - 09.11.2012

This is an example on how to do it with an variable

pawn Код:
new robbing[MAX_PLAYERS];

forward robc();

public robc()
{
 foreach(Player, i)
 {
 if(robbing[i] = 1)
  {
  GivePlayerMoney(i,9000);
  }
 }
 return 1;
}



Re: Problem with timer - davve95 - 09.11.2012

Thanks alot all!