SA-MP Forums Archive
Think about a car shop - 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: Think about a car shop (/showthread.php?tid=617194)



Think about a car shop - asto63 - 17.09.2016

Hello,

Actually i'm creating a RP Gamemode, and i'm creating a car selling system, but i want it better than other GM we can find on Servers ( On french servers ^^ ), so i have this : http://prntscr.com/cj0pab

But now, i don't know how to do, to make that the car buyable in datas are showed when we click on the arrow ...
At now, the screen u can see is just a textdraw, nothing else ! No system in it....

The only thing i have, is a enum with all veh datas, and know if the veh is buyable or not.

I don't know how to do this system, like in thinking, not like in code u see ?

Thanks for the help u can provide


Re: Think about a car shop - Shinja - 17.09.2016

https://sampwiki.blast.hk/wiki/TextDrawSetSelectable
https://sampwiki.blast.hk/wiki/OnPlayerClickTextDraw
or if you are using PlayerTextDraw
https://sampwiki.blast.hk/wiki/PlayerTextDrawSetSelectable
https://sampwiki.blast.hk/wiki/OnPlayerClickPlayerTextDraw


Re: Think about a car shop - asto63 - 17.09.2016

No, i know this, i don't mean this, i mean i want to know, because i still think about this, but i don't solve the problem.

I want when we click on the arrow, it switch of vehicle, but how make that the textdraw switch of vehicle? How put vehicle in the list? How make that when we click on the arrow, we go to the next car ... I don't know how to make it. I know the functions. Idk if i'm explaining well... I'm french so ^^


Re: Think about a car shop - Shinja - 17.09.2016

I'll give you an example,
PHP код:
//When player click "Next"
new string[30];
format(stringsizeof(string), "%s"GetVehicleName(nextvehicle));
TextDrawSetString(vehiclenamestring);
format(stringsizeof(string), "$ %d"Vehicle[nextvehicle][Price]);
TextDrawSetString(vehiclepricestring);
format(stringsizeof(string), "%d  ~b~km"Vehicle[nextvehicle][km]);
TextDrawSetString(vehiclespeedstring);
//Then show em again to apply changes
TextDrawShowForPlayer(playeridvehiclename);
TextDrawShowForPlayer(playeridvehicleprice);
TextDrawShowForPlayer(playeridvehiclespeed); 



Re: Think about a car shop - asto63 - 17.09.2016

No ok, wait i will re-explain everything, i think clearly.
Let's ****** translate talk:
"I do not know how to make the vehicles to record in a table when loading (if they are for sale), and when you click on an arrow, go get it the next vehicle that is for sale and display it"

I think it's better now