SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 14/10/2019, 04:59 PM   #1
Proxus
Huge Clucker
 
Proxus's Avatar
 
Join Date: May 2018
Location: United Kingdom
Posts: 322
Reputation: 12
Default Alternative Text for Textdraws

What would be the best way to show alternative text for textdraws?
For example, I'd like to do something like this (if they're in a convoy):

"ur hauling this stuff" - obviously pseudo
wait 5 seconds
"in convoy with blahblah"

I assume it'd be something like this (in pseudocode)

Code:
REPEAT
SET textdrawtxt TO "ur hauling this stuff"
WAIT 5 SECONDS
SET textdrawtxt TO "in convoy with blahblahblah"
UNTIL job ended
__________________
Developer @ Trucknation
Administrator & Developer @ Lost Legacy
"Never tell people how to do things. Tell them what to do and they will surprise you with their ingenuity"


IMPORTANT LINKS
Proxus is offline   Reply With Quote
Old 14/10/2019, 05:07 PM   #2
Kwarde
High-roller
 
Kwarde's Avatar
 
Join Date: Nov 2009
Location: The Netherlands
Posts: 2,443
Reputation: 1620
Default Re: Alternative Text for Textdraws

TextDrawSetString is it you want I assume?
Kwarde is online now   Reply With Quote
Old 14/10/2019, 05:35 PM   #3
Proxus
Huge Clucker
 
Proxus's Avatar
 
Join Date: May 2018
Location: United Kingdom
Posts: 322
Reputation: 12
Default Re: Alternative Text for Textdraws

Quote:
Originally Posted by Kwarde View Post
TextDrawSetString is it you want I assume?
Yeah I get that. But what would be the best way to "alternate" is the thing I'm trying to get at. Would setting a timer to change the text every 5 seconds work well or is there an easier solution?
__________________
Developer @ Trucknation
Administrator & Developer @ Lost Legacy
"Never tell people how to do things. Tell them what to do and they will surprise you with their ingenuity"


IMPORTANT LINKS
Proxus is offline   Reply With Quote
Old 14/10/2019, 05:40 PM   #4
Kwarde
High-roller
 
Kwarde's Avatar
 
Join Date: Nov 2009
Location: The Netherlands
Posts: 2,443
Reputation: 1620
Default Re: Alternative Text for Textdraws

Aaah I see. A timer will most certainly do the job.
Another way could be checking it in OnPlayerUpdate() and check if the 5 seconds are passed using gettime() (UNIX timestamp). I'd personally just go for the timer.
Kwarde is online now   Reply With Quote
Old 15/10/2019, 06:16 PM   #5
Markski
Big Clucker
 
Markski's Avatar
 
Join Date: Apr 2015
Location: La Plata, Argentina
Posts: 94
Reputation: 17
Default Re: Alternative Text for Textdraws

There's no elegant solution such as waits for this in Pawn since everything is single threaded. You'll need to use timers.
__________________
mashallah
Markski is offline   Reply With Quote
Old 15/10/2019, 06:22 PM   #6
Kwarde
High-roller
 
Kwarde's Avatar
 
Join Date: Nov 2009
Location: The Netherlands
Posts: 2,443
Reputation: 1620
Default Re: Alternative Text for Textdraws

Did you read my post Markski? Right above yours. It is possible (tho timer is still the most convenient choice)
Kwarde is online now   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
The problem with 3d text and textdraws Vlad_Dredd Scripting Help 2 26/07/2014 04:45 AM
Textdraws or 3d text label Lajko1 Scripting Help 3 14/09/2013 04:19 PM
Alternative way to show much text RyanDam Scripting Help 2 31/10/2012 08:47 PM
Textdraws, menu text and moneybar fading WTF!? Pooh7 Help Archive 4 23/01/2011 01:57 PM
A little problem with textdraws/3d text's Code_Red Help Archive 0 09/01/2011 07:26 PM


All times are GMT. The time now is 08:25 AM.


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