How to get %s in text draw
#1

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);
Reply
#2

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.
Reply
#3

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);
Reply
#4

pawn Код:
error 017: undefined symbol "i"
Reply
#5

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);
Reply
#6

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);
Reply
#7

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);
Reply
#8

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!
Reply
#9

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.
Reply
#10

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


Forum Jump:


Users browsing this thread: 1 Guest(s)