anyone know?
#1

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?
Reply
#2

GameTextForAll has only 3 parameters, so it should be this way
PHP код:
GameTextForAll("Text blah blah blah"10004); 
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(raceMessagesizeof(raceMessage), "Race start after: %d seconds"RACE_STARTING_TIMER);
GameTextForAll(raceMessage10004); 
or you could skip using a Format function and do it this way
PHP код:
GameTextForAll("Race starts after 40 seconds"10004); 
to make a timer, use SetTimer Function
PHP код:
forward RacingStartTimer();
//Without RACE_STARTING_TIMER macro
SetTimer("RacingStartTimer"40000false);
//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
Reply
#3

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(raceMessagesizeof(raceMessage), "Race start after: %d seconds"RACE_STARTING_TIMER); 
GameTextForAll(raceMessage10004); 
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?
Reply
#4

Bind this to a command
PHP код:
new raceMessage[32];  
format(raceMessagesizeof(raceMessage), "Race start after: %d seconds"RACE_STARTING_TIMER);  
GameTextForAll(raceMessage10004); 
Reply
#5

Thanks worked.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)