anyone know? - 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: anyone know? (
/showthread.php?tid=636149)
anyone know? -
Thanks - 21.06.2017
Hi.. if you can help me post.. i need a GameTextForAll("
Race Start After: %d", 1000, 4, [HERE I DONT KNOW WHAT I MUST TO PUT]");
So how to make a Timer with gametext 40secdons?
Re: anyone know? -
Eoussama - 21.06.2017
GameTextForAll has only 3 parameters, so it should be this way
PHP код:
GameTextForAll("Text blah blah blah", 1000, 4);
you can't format texts inside of this function, you gotta use
Format function
PHP код:
#define RACE_STARTING_TIMER 40000 //40*1000 > 40 seconds multiplied by 1000 milliseconds
new raceMessage[32];
format(raceMessage, sizeof(raceMessage), "Race start after: %d seconds", RACE_STARTING_TIMER);
GameTextForAll(raceMessage, 1000, 4);
or you could skip using a Format function and do it this way
PHP код:
GameTextForAll("Race starts after 40 seconds", 1000, 4);
to make a timer, use
SetTimer Function
PHP код:
forward RacingStartTimer();
//Without RACE_STARTING_TIMER macro
SetTimer("RacingStartTimer", 40000, false);
//With RACE_STARTING_TIMER macro
SetTimer("RacingStartTimer", RACE_STARTING_TIMER , false);
public RacingStartTimer()
{
SendClinetMessageToAll("The race has started", 0xFFFF0088);
}
Please make sure to check up these links for more info
https://sampwiki.blast.hk/wiki/GameTextForAll
https://sampwiki.blast.hk/wiki/Format
https://sampwiki.blast.hk/wiki/SetTimer
and remember to always
****** first, I'm sure similar questions were asked before
Re: anyone know? -
Thanks - 21.06.2017
Im putting this at top script:
Код:
#define RACE_STARTING_TIMER 40000 //40*1000 > 40 seconds multiplied by 1000 milliseconds
This at
OnPlayerSpawn
PHP код:
new raceMessage[32];
format(raceMessage, sizeof(raceMessage), "Race start after: %d seconds", RACE_STARTING_TIMER);
GameTextForAll(raceMessage, 1000, 4);
Timers at
OnGameModeInit
Код HTML:
//Without RACE_STARTING_TIMER macro
SetTimer("RacingStartTimer", 40000, false);
//With RACE_STARTING_TIMER macro
SetTimer("RacingStartTimer", RACE_STARTING_TIMER , false);
and this below scirpt:
Код:
forward RacingStartTimer();
public RacingStartTimer()
{
SendClinetMessageToAll("The race has started", 0xFFFF0088);
}
after i joined the game then Trying to test it im not see the GameText Why?
Re: anyone know? -
Eoussama - 21.06.2017
Bind this to a command
PHP код:
new raceMessage[32];
format(raceMessage, sizeof(raceMessage), "Race start after: %d seconds", RACE_STARTING_TIMER);
GameTextForAll(raceMessage, 1000, 4);
Re: anyone know? -
Thanks - 21.06.2017
Thanks worked.