timer does not start (rep+)
#1

PHP код:
CMD:ja(playeridparams[])
{
    
SetPlayerPos(playerid264.6689,77.6638,1001.0391);
    
SetPlayerInterior(playerid6);
    
SetPlayerFacingAngle(playerid270.6995);
    
SetTimerEx("In123"2*60000true"i"playerid);
    
PlayerInfo[playerid][pJ123] = 120;
    return 
1;

i write the command, and it sets me to coordinations, but the text, that is supposed to be shown, does not show, i even tried to debug it, by printing inside the timer function, but that did not show either

PHP код:
forward In123(playerid);
public 
In123(playerid)
{
    new 
string[128];
    
PlayerInfo[playerid][pJ123] --;
    
format(stringsizeof(string), "zbyva: %d"PlayerInfo[playerid][pJ123]);
    
SendClientMessage(playeridADMINstring);
    if(
PlayerInfo[playerid][pJ123] == 0)
    {
        
SpawnPlayer(playerid);
        
SendClientMessage(playeridSERVER"Byl jsi propuљtěn");
    }
    return 
1;

for anyhelp i would appreciate
Reply
#2

Im not sure but i think 2*60000 should be 1000.
remove the 2*.
1000 = 1 sec.
Reply
#3

First thing my math sucks, try define this for timers then put example

on top

Код:
#define Seconds(%0) 				(( %0 ) * ( 1000 ))
#define Minutes(%0) 				(( %0 ) * ( 1000*60 ))
#define Hours(%0) 				(( %0 ) * ( 1000*60*60 ))
Код:
SetTimerEx("In123", Minutes(1), true, "i", playerid); //1 minute timer.
then try
Reply
#4

dude, u waited this for 2 hours? I don't think so.
60000*2=120000 ms, which is 2 hours.
Reply
#5

*2 minutes

Yes, nevermind, corrected myself almost asap, but forgot to write here.
Reply
#6

Quote:
Originally Posted by Mugalito
Посмотреть сообщение
dude, u waited this for 2 hours? I don't think so.
60000*2=120000 ms, which is 2 hours.
lol 120,000 ms is 120 seconds = 2 minutes not 2 hours... 1 second is 1000 ms, you take 120,000 divide it by 1000 that'll give you 120 seconds, take that divide it by 60 you'll get 2 (minutes) that isn't 2 hours people...
Reply
#7

Quote:
Originally Posted by RogueDrifter
Посмотреть сообщение
lol 120,000 ms is 120 seconds = 2 minutes not 2 hours... 1 second is 1000 ms, you take 120,000 divide it by 1000 that'll give you 120 seconds, take that divide it by 60 you'll get 2 (minutes) that isn't 2 hours people...
yeah I'm blind.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)