Max+ Posted April 5, 2013 Share Posted April 5, 2013 Hello Guys Iam not Good in Tables, i want to make a selection of skins and then spawn Just like Sa:mp selection skin then spawn ? with buttons Right - Left - Spawn . can some one show me an example ? Link to comment
tosfera Posted April 5, 2013 Share Posted April 5, 2013 Making a table isn't that hard, all I know is that a table is the same as an array. The most usefull thing to do is in your situation is to create a double array (array in an array). skins = { { "skinid", "skin desc" } , { "skinid","skin desc" } }; Then use a loop to get all the skins, and a math.rand to start off with. After that, just bind the left and right button/arrow keys to make it go to the next index of the array. Link to comment
DNL291 Posted April 5, 2013 Share Posted April 5, 2013 skins = { { "skinid", "skin desc" } , { "skinid","skin desc" } }; Skin id is a numeric value not a string. Use local variables. Link to comment
Max+ Posted April 5, 2013 Author Share Posted April 5, 2013 i dont mean skins table i mean how to make Spawn Manger with Buttons , if resource start show 3 buttons < -- Go -- > if be press -- > then +1 skin if < -- then -1 skin go = spawn in spawn points , Just like Sa:Mp skin selector , Link to comment
iPrestege Posted April 5, 2013 Share Posted April 5, 2013 There's no need to use table ._. just use : createPed setElementFrozen setPedAnimation guiCreateButton or bindKey setElementModel Link to comment
Max+ Posted April 5, 2013 Author Share Posted April 5, 2013 OK , Thank's I'm going to Try it , Link to comment
iPrestege Posted April 5, 2013 Share Posted April 5, 2013 No problem if you have problem with anything post it here and we will help you . Link to comment
Max+ Posted April 5, 2013 Author Share Posted April 5, 2013 No problem if you have problem with anything post it here and we will help you . I really appreciate your help, Link to comment
Max+ Posted April 5, 2013 Author Share Posted April 5, 2013 is it possible to make a table with gui Buttons ? and how ? Link to comment
iPrestege Posted April 5, 2013 Share Posted April 5, 2013 Yes you can do that like this : local ID = { [1] = {x,y,width,height,"Test[1]"}, [2] = {x,y,width,height,"Test[2]"} } for _,v in ipairs ( ID ) do Button = guiCreateButton(v[1],v[2],v[3],v[4],v[5],false) end Remember "relative" or not "true > false" Link to comment
Max+ Posted April 5, 2013 Author Share Posted April 5, 2013 Iam understanding Tables Thank's to You Fahode , But if i want table for onClientGUIClick ? Link to comment
iPrestege Posted April 5, 2013 Share Posted April 5, 2013 I dont think that you can do it because it's something hard i dont think that i can do it but also i dont think any one can do it ._. because it's a Variables "Button" how can any one do it ._.? i dkn . Link to comment
Max+ Posted April 5, 2013 Author Share Posted April 5, 2013 lol, iam Going to Try doing it , and add it to Useful function lol , Link to comment
iPrestege Posted April 5, 2013 Share Posted April 5, 2013 it will be miracle if you do it . Link to comment
Max+ Posted April 5, 2013 Author Share Posted April 5, 2013 (edited) This is My Buttons it debug of mta script edtor i tryed close the tabel but i cant, local ID = { [1] = [1.30,1.22,5,20,"<<<-"] [2] = [2.90,1.22,5,20,"->>>"] [3] = [1.80,1.22,5,20,"Ready!"] Now My GameMode it's 60% Tabels , it's Better, Edited April 5, 2013 by Guest Link to comment
iPrestege Posted April 5, 2013 Share Posted April 5, 2013 What you mean? can you show some ex? Link to comment
Max+ Posted April 5, 2013 Author Share Posted April 5, 2013 I mean the Buttons Table i show you in the debug i must close the Table go to mta script edtor and paste my Buttons Table and see the debug, Link to comment
iPrestege Posted April 5, 2013 Share Posted April 5, 2013 Maybe you can do some thing like : local xxx = guiGetText(Button) if xxx == "Test[1]" then -- do some fuck end; Link to comment
Max+ Posted April 5, 2013 Author Share Posted April 5, 2013 Never Mined i will Talk to SolidSnake14, Link to comment
Ludo Posted April 5, 2013 Share Posted April 5, 2013 localID = { {1.30,1.22,5,20,"<<<-"}, {2.90,1.22,5,20,"->>>"}, {1.80,1.22,5,20,"Ready!"} } You have to put a "," after a row of a table. Anyway you must use {} to define a table with multiple values, as you can get it with double table pointer: for i, value in ipairs(localID) do guiCreateButton(localID[value][1], localID[value][2], localID[value][3], localID[value][4], localID[value][5], false) -- I copied Mr.Pres[T]ege's post values, but you can edit them end Link to comment
Max+ Posted April 6, 2013 Author Share Posted April 6, 2013 Ok Thank's Ludo , i Hope i finsh My GameMode Lol, Link to comment
Ludo Posted April 6, 2013 Share Posted April 6, 2013 Ok Thank's Ludo ,i Hope i finsh My GameMode Lol, You are welcome Good luck with your gamemode! Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now