SA-MP Forums Archive
SetTimerEx string - 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: SetTimerEx string (/showthread.php?tid=292713)



SetTimerEx string - MP2 - 24.10.2011

SetTimerEx can't pass strings. I know that. Is there a way to do it?


Re: SetTimerEx string - Ash. - 24.10.2011

I believe y_timers has such implementation, I wouldn't quote me on that though, as I haven't actually looked into it.


Re: SetTimerEx string - =WoR=Varth - 25.10.2011

By creating a global variable and store the string there.


Re: SetTimerEx string - MP2 - 25.10.2011

Quote:
Originally Posted by =WoR=Varth
Посмотреть сообщение
By creating a global variable and store the string there.
Could you elaborate?


Re: SetTimerEx string - =WoR=Varth - 25.10.2011

pawn Код:
#define MAX_TIMERS  512

new String[MAX_TIMERS][128];//Global
    timerid;

//Somewhere
SetTimerEx("blahblahblah",1000,1,"dd",playerid,timerid);
format(String[timerid],sizeof(String),"%s","Your string here");
timerid++;


public blahblahblah(playerid,id)
{
    SendClientMessage(playerid,-1,String[id]);



Re: SetTimerEx string - MP2 - 25.10.2011

Timer IDs go up way past 512 AFAIK they don't 'replace' finished timers. I have hundreds of timers in my gamemode. I'm not going to create a 290865209465436 cell array with 128 cells per timer ID to store strings in..


Re: SetTimerEx string - =WoR=Varth - 25.10.2011

I knew that already. I'm just giving an example.
Another method can be done with GVar (Search this include in include section).
There's many method you can try.