SA-MP Forums Archive
How to code like this - 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 code like this (/showthread.php?tid=577226)



How to code like this - sscarface - 09.06.2015

Hi, I want something like this on textdraw

I type /carshop

Textdraw Menu:

1.Cars
2.Bikes

If i Select cars which means number 1.

Textdraw cars:
1.Infernus
2.Bullet

if i select Bikes which means number 2

1. NRG
2. FCR


How to script like this?


Re: How to code like this - AlexBlack - 10.06.2015

Use TDEditor to create a textdraws ( https://sampforum.blast.hk/showthread.php?tid=543002 ) then you need a callback named "OnPlayerClickTextDraw"

for example

PHP код:
public OnPlayerClickTextDraw(playeridText:clickedid)
{
    if(
clickedid == TextDrawVariable// here you put the variable of the textdraw
    
{
        
// here you put what you want to do when the player click on the textdraw.
        
return 1;
    }
    return 
1;