SA-MP Forums Archive
How to get %s in text draw - 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: How to get %s in text draw (/showthread.php?tid=303917)



How to get %s in text draw - SnG.Scot_MisCuDI - 16.12.2011

Sup, how can i make it so i can use %s in a text draw. Like i type /startevent (name) and it shows (name) has started!
I got it to work with sendclientmessage but i dont know how for Gametextforall

example:
pawn Код:
format(string, 120, "[EVENT] %s Has Started. Type /yes to join.",tmp);
that will show in chatbox [EVENT]noob Has Started. Type /yes to join.

But then on the text draw it will show EVENT HAS STARTED type /yes to join. How can i changed the word EVENT to the name it sends in chat box.

pawn Код:
GameTextForAll("~w~ %s Has Started Type ~n~~r~/Yes ~g~To Join!",6000,3);



Re: How to get %s in text draw - SnG.Scot_MisCuDI - 16.12.2011

Quote:
Originally Posted by belhot1992
Посмотреть сообщение
Do it this way, it's better:

pawn Код:
format(string, 120, "[EVENT] %s Has Started. Type /yes to join.",tmp);
for(new i; i<MAX_PLAYERS; i++)
{
   SendClientMessage(i, COLOR_YELLOW, string);
   return 1;
}
that wont make it show the event name on the screen. With a text draw. I need the GameTextForAll part.


Re: How to get %s in text draw - Haydz - 16.12.2011

Quote:
Originally Posted by belhot1992
Посмотреть сообщение
Do it this way, it's better:

pawn Код:
format(string, 120, "[EVENT] %s Has Started. Type /yes to join.",tmp);
for(new i; i<MAX_PLAYERS; i++)
{
   SendClientMessage(i, COLOR_YELLOW, string);
   return 1;
}
Why should he use a loop to send the message? just use SendClientMessageToAll

pawn Код:
format(string, 70, "[EVENT] %s Has Started. Type /yes to join.",tmp);
GameTextForAll(string,6000,3);



Re: How to get %s in text draw - SnG.Scot_MisCuDI - 16.12.2011

pawn Код:
error 017: undefined symbol "i"



Re: How to get %s in text draw - Ballu Miaa - 16.12.2011

Quote:
Originally Posted by googamalugafoo
Посмотреть сообщение
pawn Код:
error 017: undefined symbol "i"
As they already stated! Use this one
pawn Код:
format(string, 70, "[EVENT] %s Has Started. Type /yes to join.",tmp);
GameTextForAll(string,6000,3);



Re: How to get %s in text draw - SnG.Scot_MisCuDI - 16.12.2011

Quote:
Originally Posted by Ballu Miaa
Посмотреть сообщение
As they already stated! Use this one
pawn Код:
format(string, 70, "[EVENT] %s Has Started. Type /yes to join.",tmp);
GameTextForAll(string,6000,3);
yeah i edited the code to that. But how can i change with ~w~ ~n~ and stuff
pawn Код:
GameTextForAll(string,6000,3);



Re: How to get %s in text draw - Thresholdold - 16.12.2011

Quote:
Originally Posted by googamalugafoo
Посмотреть сообщение
yeah i edited the code to that. But how can i change with ~w~ ~n~ and stuff
pawn Код:
GameTextForAll(string,6000,3);
with the format(string... just put ~w~ and ~n~ where you would want them to go as if they were part of GameTextForPlayer...

Example:
pawn Код:
format(string, 70, "~g~[EVENT] %s Has ~r~Started. ~n~~w~Type ~r~/yes ~g~to join.",tmp);



Re: How to get %s in text draw - Ballu Miaa - 16.12.2011

Quote:
Originally Posted by Threshold
Посмотреть сообщение
with the format(string... just put ~w~ and ~n~ where you would want them to go as if they were part of GameTextForPlayer...

Example:
pawn Код:
format(string, 70, "~g~[EVENT] %s Has ~r~Started. ~n~~w~Type ~r~/yes ~g~to join.",tmp);
Exactly!


Re: How to get %s in text draw - SnG.Scot_MisCuDI - 16.12.2011

Quote:
Originally Posted by Threshold
Посмотреть сообщение
with the format(string... just put ~w~ and ~n~ where you would want them to go as if they were part of GameTextForPlayer...

Example:
pawn Код:
format(string, 70, "~g~[EVENT] %s Has ~r~Started. ~n~~w~Type ~r~/yes ~g~to join.",tmp);
When i do this it shows in the text box the ~w~ etc.


Re: How to get %s in text draw - suhrab_mujeeb - 17.12.2011

Or use a textdraw and then use a timer to turn it off. How hard could that be?