Public function, taxupdater - Printable Version +- Las Venturas Playground (https://forum.sa-mp.nl) +-- Forum: Miscellaneous (https://forum.sa-mp.nl/forum-4.html) +--- Forum: Gaming (https://forum.sa-mp.nl/forum-27.html) +--- Thread: Public function, taxupdater (/thread-8230.html) |
Public function, taxupdater - Dimplex - 04-22-2008 Hey all, I need some help whit a public function i made. This is the idea, If you have over the 3mil, you pay every 2 min 100000. Now i made this: Code: forward TaxUpdater(); Code: public TaxUpdater() Code: SetTimer("TaxUpdater", 180000, 1); How i must fix this? Grtz Dimplex Re: Public function, taxupdater - Jay - 04-22-2008 I can't see the problem to be honest, is the message appearing saying that the player has payed the tax? also: GivePlayerMoney(i,-100000); Should be: GivePlayerMoney(i,0-100000); [me=Jay]sucks @ maths[/me] Re: Public function, taxupdater - Dimplex - 04-22-2008 no, he dont get the money and dont send the message Re: Public function, taxupdater - Xanland - 04-22-2008 No Jay. Code: GivePlayerMoney(i,-100000); Re: Public function, taxupdater - Jay - 04-22-2008 Well, whatever, But There are no problems with the code you posted Dimplex. Re: Public function, taxupdater - The_Zodiac - 04-23-2008 Dimplex you could try: Code: forward TaxUpdater(); Code: forward TaxUpdater(playerid); And change your settimer ex for: Code: for(new i=0;i<MAX_PLAYERS;i++){SetTimerEx("TaxUpdater", 180000, 1,"i",i);} Code: public TaxUpdater() It's the same result...anyway i'd try it. Posting your full code in pastebin should be useful too Zodiac Re: Public function, taxupdater - Jay - 04-23-2008 Well, whats the difference? except your version setting 200 indivdual timers for each player. You should check if the player is connected when looping. Re: Public function, taxupdater - Smoke - 04-24-2008 did you put SetTimer("TaxUpdater", 180000, 1); under OnGameModeInit?? Re: Public function, taxupdater - Dimplex - 04-24-2008 (04-24-2008, 11:03 AM)Smoke link Wrote: did you putYes i did, Now i changed it whit the help of zodiac. Now it is this: Code: public TaxUpdater(playerid) But now he gives this errors, Code: D:\Scripting\GTA SA Samp\gamemodes\SecondLife.pwn(450) : error 017: undefined symbol "i" Grtz and thnx, Dimplex Re: Public function, taxupdater - Joeri - 04-24-2008 Code: [quote='The_Zodiac link' pid='7834' dateline='1208911845'] There is no need to declare a function with the parameters included. First, indent you code corectly D: Code: public TaxUpdater(playerid) But, that code will cause a huge CPU load This is better: Code: top: just a tip: you can check if a timer is running by simple adding a 'debug message', just a simple SendClientMessageToAll(white, "Time activated"); to the function it should trigger. -oost |