SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 16/12/2011, 02:28 AM   #1
SnG.Scot_MisCuDI
Gangsta
 
SnG.Scot_MisCuDI's Avatar
 
Join Date: Mar 2011
Location: Gilbert, Arizona
Posts: 883
Reputation: 56
Default How to get %s in text draw

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 Code:
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 Code:
GameTextForAll("~w~ %s Has Started Type ~n~~r~/Yes ~g~To Join!",6000,3);
__________________

aka Googamalugafoo
[FS/Tool] Dynamic Biz - Dynamic Bank - FFA DM - Pawno Tool
[Tuts] Map Editor - Nuke - Using Pickups - Timers


SnG.Scot_MisCuDI is offline   Reply With Quote
Old 16/12/2011, 02:36 AM   #2
SnG.Scot_MisCuDI
Gangsta
 
SnG.Scot_MisCuDI's Avatar
 
Join Date: Mar 2011
Location: Gilbert, Arizona
Posts: 883
Reputation: 56
Default Re: How to get %s in text draw

Quote:
Originally Posted by belhot1992 View Post
Do it this way, it's better:

pawn Code:
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.
__________________

aka Googamalugafoo
[FS/Tool] Dynamic Biz - Dynamic Bank - FFA DM - Pawno Tool
[Tuts] Map Editor - Nuke - Using Pickups - Timers


SnG.Scot_MisCuDI is offline   Reply With Quote
Old 16/12/2011, 02:42 AM   #3
Haydz
Gangsta
 
Haydz's Avatar
 
Join Date: Jul 2010
Location: New Zealand
Posts: 752
Reputation: 44
Default Re: How to get %s in text draw

Quote:
Originally Posted by belhot1992 View Post
Do it this way, it's better:

pawn Code:
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 Code:
format(string, 70, "[EVENT] %s Has Started. Type /yes to join.",tmp);
GameTextForAll(string,6000,3);
__________________

Don't view these forums much anymore, still check every once and awhile so if you send me a PM It'll take a bit for me to respond!
Haydz is offline   Reply With Quote
Old 16/12/2011, 02:43 AM   #4
SnG.Scot_MisCuDI
Gangsta
 
SnG.Scot_MisCuDI's Avatar
 
Join Date: Mar 2011
Location: Gilbert, Arizona
Posts: 883
Reputation: 56
Default Re: How to get %s in text draw

pawn Code:
error 017: undefined symbol "i"
__________________

aka Googamalugafoo
[FS/Tool] Dynamic Biz - Dynamic Bank - FFA DM - Pawno Tool
[Tuts] Map Editor - Nuke - Using Pickups - Timers


SnG.Scot_MisCuDI is offline   Reply With Quote
Old 16/12/2011, 02:55 AM   #5
Ballu Miaa
High-roller
 
Ballu Miaa's Avatar
 
Join Date: Apr 2010
Location: New Delhi,India
Posts: 1,849
Reputation: 323
Default Re: How to get %s in text draw

Quote:
Originally Posted by googamalugafoo View Post
pawn Code:
error 017: undefined symbol "i"
As they already stated! Use this one
pawn Code:
format(string, 70, "[EVENT] %s Has Started. Type /yes to join.",tmp);
GameTextForAll(string,6000,3);
__________________


I will take half payment as an advance to script for you.
Click here to request my Scripting Service.

Ballu Miaa is offline   Reply With Quote
Old 16/12/2011, 03:08 AM   #6
SnG.Scot_MisCuDI
Gangsta
 
SnG.Scot_MisCuDI's Avatar
 
Join Date: Mar 2011
Location: Gilbert, Arizona
Posts: 883
Reputation: 56
Default Re: How to get %s in text draw

Quote:
Originally Posted by Ballu Miaa View Post
As they already stated! Use this one
pawn Code:
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 Code:
GameTextForAll(string,6000,3);
__________________

aka Googamalugafoo
[FS/Tool] Dynamic Biz - Dynamic Bank - FFA DM - Pawno Tool
[Tuts] Map Editor - Nuke - Using Pickups - Timers


SnG.Scot_MisCuDI is offline   Reply With Quote
Old 16/12/2011, 03:11 AM   #7
Thresholdold
Huge Clucker
 
Thresholdold's Avatar
 
Join Date: Sep 2011
Location: Inside your RCON
Posts: 441
Reputation: 30
Default Re: How to get %s in text draw

Quote:
Originally Posted by googamalugafoo View Post
yeah i edited the code to that. But how can i change with ~w~ ~n~ and stuff
pawn Code:
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 Code:
format(string, 70, "~g~[EVENT] %s Has ~r~Started. ~n~~w~Type ~r~/yes ~g~to join.",tmp);
__________________
Thresholdold is offline   Reply With Quote
Old 16/12/2011, 03:22 AM   #8
Ballu Miaa
High-roller
 
Ballu Miaa's Avatar
 
Join Date: Apr 2010
Location: New Delhi,India
Posts: 1,849
Reputation: 323
Default Re: How to get %s in text draw

Quote:
Originally Posted by Threshold View Post
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 Code:
format(string, 70, "~g~[EVENT] %s Has ~r~Started. ~n~~w~Type ~r~/yes ~g~to join.",tmp);
Exactly!
__________________


I will take half payment as an advance to script for you.
Click here to request my Scripting Service.

Ballu Miaa is offline   Reply With Quote
Old 16/12/2011, 10:27 AM   #9
eеe
Huge Clucker
 
eеe's Avatar
 
Join Date: Oct 2011
Location: pawno.exe :P New Delhi/India
Posts: 326
Reputation: 49
Default Re: How to get %s in text draw

Quote:
Originally Posted by Ballu Miaa View Post
Exactly!
Trying to be smart huh..
__________________
If i have ever helped you please help me back by clicking here.Thank you.
Scripting for $$$ PM me for details.
Developing websites for $$$ for all occasions PM me for details.
Volt-Host 50% OFF use discount coupon - GETBACK
eеe is offline   Reply With Quote
Old 16/12/2011, 09:21 PM   #10
SnG.Scot_MisCuDI
Gangsta
 
SnG.Scot_MisCuDI's Avatar
 
Join Date: Mar 2011
Location: Gilbert, Arizona
Posts: 883
Reputation: 56
Default Re: How to get %s in text draw

Quote:
Originally Posted by Threshold View Post
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 Code:
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.
__________________

aka Googamalugafoo
[FS/Tool] Dynamic Biz - Dynamic Bank - FFA DM - Pawno Tool
[Tuts] Map Editor - Nuke - Using Pickups - Timers


SnG.Scot_MisCuDI is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[HELP]text draw bboytimix Server Support 0 05/03/2011 01:28 PM
[FilterScript] Text-Draw Box Awesome@Man Filterscripts 12 26/08/2010 03:55 PM
[HELP] Text Draw Need TraNe15 Help Archive 6 19/09/2009 07:54 PM


All times are GMT. The time now is 06:22 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.