Jump to content

Cerere Script textdraw


DuKe
 Share

Recommended Posts

  • Descriere problema: Doresc si eu un script in sanny builder, un textdraw mai exact (cum sunt cele de la taxi helper, copcmd), un fel de namecflow mai exat, dar static. 
  • Poze / Video (optional): -
  • Cod (sursa pe baza caruia sa ajutam, daca e cazul): -
  • Alte precizări: Daca se poate sa fie si pe culori, gen la text sa ii schimb eu culoare si sa fie 2 exemple de texte (ca sa imi dau seama ce sa copiez), dupa le multiplic eu.
Link to comment
Share on other sites

Hello @ DuKe ,

To make textdraws or Customise you need to use the following opcodes:

0C48: samp textdraw 0@ create "Textdraw" pos 1@ 2@
0C49: samp textdraw 0@ set_box true color 2@ size 3@ 4@
0C4A: samp textdraw 0@ set_align 1
0C4B: samp textdraw 0@ set_proportional true
0C4C: samp textdraw 0@ set_style 2
0C4D: samp textdraw 0@ set_shadow 1 color 2@
0C4E: samp textdraw 0@ set_outline 2 color 2@
0C4F: samp textdraw 0@ set_model 1337 rotation 2@ 3@ 4@ zoom 1.0 veh_color 0 0
0C50: samp textdraw 0@ set_string 1@
0C51: samp textdraw 0@ set_pos 1@ 2@
0C52: samp textdraw 0@ set_letter_size 1@ 2@ color 3@
0C53: samp textdraw 0@ get_box_enabled 1@ color 2@ size 3@ 4@


heres an exemple of a script:

{$CLEO .cs}


0000: NOP

thread "Textdraw"

repeat
    wait 10
until SAMP.Available

wait 2000
// exemple 1
0C48: samp textdraw 599 create "Exemple_1" pos 557.0 300.0  // 599 is the textdraw id, "Exemple_1" = the text, 'pos' = the position of your textdraw
0C52: samp textdraw 599 set_letter_size 0.21 1.10 color -8391919 // Set the size and the color of th
0C4C: samp textdraw 599 set_style 1 // Font Style
0C4D: samp textdraw 599 set_shadow 1 color -16448253 // 1 to enable shadow (+ the color of the shadow) || 0 to disable 

// exemple 2
0C48: samp textdraw 594 create "Exemple_2" pos 557.0 330.0 
0C52: samp textdraw 594 set_letter_size 0.4 1.10 color -891919
0C4C: samp textdraw 594 set_style 0
0C4D: samp textdraw 594 set_shadow 0 color -16448253 

// exemple 3
0C48: samp textdraw 592 create "Exemple_Number_3" pos 557.0 360.0 
0C52: samp textdraw 592 set_letter_size 0.21 0.90 color -83919
0C4C: samp textdraw 592 set_style 3
0C4D: samp textdraw 592 set_shadow 1 color -16443 

WHILE True
    wait 10
END


 

Edited by AdeM nWo
Link to comment
Share on other sites

8 hours ago, AdeM nWo said:

Hello @ DuKe ,

To make textdraws or Customise you need to use the following opcodes:

0C48: samp textdraw 0@ create "Textdraw" pos 1@ 2@
0C49: samp textdraw 0@ set_box true color 2@ size 3@ 4@
0C4A: samp textdraw 0@ set_align 1
0C4B: samp textdraw 0@ set_proportional true
0C4C: samp textdraw 0@ set_style 2
0C4D: samp textdraw 0@ set_shadow 1 color 2@
0C4E: samp textdraw 0@ set_outline 2 color 2@
0C4F: samp textdraw 0@ set_model 1337 rotation 2@ 3@ 4@ zoom 1.0 veh_color 0 0
0C50: samp textdraw 0@ set_string 1@
0C51: samp textdraw 0@ set_pos 1@ 2@
0C52: samp textdraw 0@ set_letter_size 1@ 2@ color 3@
0C53: samp textdraw 0@ get_box_enabled 1@ color 2@ size 3@ 4@


heres an exemple of a script:

{$CLEO .cs}


0000: NOP

thread "Textdraw"

repeat
    wait 10
until SAMP.Available

wait 2000
// exemple 1
0C48: samp textdraw 599 create "Exemple_1" pos 557.0 300.0  // 599 is the textdraw id, "Exemple_1" = the text, 'pos' = the position of your textdraw
0C52: samp textdraw 599 set_letter_size 0.21 1.10 color -8391919 // Set the size and the color of th
0C4C: samp textdraw 599 set_style 1 // Font Style
0C4D: samp textdraw 599 set_shadow 1 color -16448253 // 1 to enable shadow (+ the color of the shadow) || 0 to disable 

// exemple 2
0C48: samp textdraw 594 create "Exemple_2" pos 557.0 330.0 
0C52: samp textdraw 594 set_letter_size 0.4 1.10 color -891919
0C4C: samp textdraw 594 set_style 0
0C4D: samp textdraw 594 set_shadow 0 color -16448253 

// exemple 3
0C48: samp textdraw 592 create "Exemple_Number_3" pos 557.0 360.0 
0C52: samp textdraw 592 set_letter_size 0.21 0.90 color -83919
0C4C: samp textdraw 592 set_style 3
0C4D: samp textdraw 592 set_shadow 1 color -16443 

WHILE True
    wait 10
END


 

How do I make a text in 2 colors?  

I have another problem, if the server crashes and I reconnect, it disappears, how do I make it permanent?
Edited by DuKe
Link to comment
Share on other sites

15 hours ago, DuKe said:

How do I make a text in 2 colors?  

I have another problem, if the server crashes and I reconnect, it disappears, how do I make it permanent?


Hello,

to solve the problem where textdraws gets deleted when you lose connection or server restarts you can simply just place the textdraw creation in the while true like this:

 

WHILE True
    wait 10
    // exemple 1
    0C48: samp textdraw 599 create "Exemple_1" pos 557.0 300.0  // 599 is the textdraw id, "Exemple_1" = the text, 'pos' = the position of your textdraw
    0C52: samp textdraw 599 set_letter_size 0.21 1.10 color -8391919 // Set the size and the color of th
    0C4C: samp textdraw 599 set_style 1 // Font Style
    0C4D: samp textdraw 599 set_shadow 1 color -16448253 // 1 to enable shadow (+ the color of the shadow) || 0 to disable 
    
    // exemple 2
    0C48: samp textdraw 594 create "Exemple_2" pos 557.0 330.0 
    0C52: samp textdraw 594 set_letter_size 0.4 1.10 color -891919
    0C4C: samp textdraw 594 set_style 0
    0C4D: samp textdraw 594 set_shadow 0 color -16448253 
    
    // exemple 3
    0C48: samp textdraw 592 create "Exemple_Number_3" pos 557.0 360.0 
    0C52: samp textdraw 592 set_letter_size 0.21 0.90 color -83919
    0C4C: samp textdraw 592 set_style 3
    0C4D: samp textdraw 592 set_shadow 1 color -16443 
END

 

for the multiple colors textdraws: textdraws in cleo doesnt support multi colors so you ll have to do x2 textdraws aligned next to each other and set their color each

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.