Jump to content

How to create Car Shop with PickUp and GUI


gamelaster

Recommended Posts

Hi, im newbie on LUA, im on lua programing only 2 days and in the wiki is small list of the creating PickUp and GUI. This is my code:

createPickup ( -3530, -201, 10, 3, 1277 ) 
function pickupUse ( thePlayer ) 
  
end 
addEventHandler ( "onPickupUse", getRootElement(), pickupUse ) 

How to create this: If im in the pickup, show GUI with list of vehicles and buttons Spawn and Cancel.(If im pickup, im freezed) If im double clicked from the vehicle name or selected vehicle and clicked to spawn, spawn vehicle in the position and unfreeze me and respawn pickup. If im click cancel, im unfreezed and respawn pickup.

Thx

Sorry for my bad english, im slovak and im kid xD

Link to comment

Okay look, first welcome to MTA Scripting, its not hard, u just need to practice a bit.

First I would suggest you to learn how to script GUI here : https://wiki.multitheftauto.com/wiki/Int ... ng_the_GUI

And then when u know how to make GUIs, you can easly do that: these event should help you https://wiki.multitheftauto.com/wiki/OnPickupHit

and ofc the freeze function:

https://wiki.multitheftauto.com/wiki/SetElementFrozen

Starting takes time, but when u learn things will be quite amazing and fun, just never give up if u really want to do something ;)

Good luck mate

Link to comment

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...