Jump to content

[Tables]


Max+

Recommended Posts

Posted

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 ?

- New , Kill System

- New, GameMode Intro

- Leve / Exp System

- New nametag showing style

- New , Hud For Players

- Skin Selection from SA-MP

- Money System / Buy Weapons

- Drop Weapons

- New, Flood System

- New , Group Assign

- Gun license For Weapons

- Random Rule System For Money

Posted

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. :)

logo-small.png?v=3 tiny-sapdfr.png

 

If you want to contact me directly concerning Advanced-Gaming, please contact me at [email protected]

Posted
  
skins = { { "skinid", "skin desc" } , { "skinid","skin desc" } }; 
  

Skin id is a numeric value not a string. Use local variables.

Please do not PM me with scripting related question nor support, use the forums instead.

Posted

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 ,

- New , Kill System

- New, GameMode Intro

- Leve / Exp System

- New nametag showing style

- New , Hud For Players

- Skin Selection from SA-MP

- Money System / Buy Weapons

- Drop Weapons

- New, Flood System

- New , Group Assign

- Gun license For Weapons

- Random Rule System For Money

Posted

OK , Thank's I'm going to Try it ,

- New , Kill System

- New, GameMode Intro

- Leve / Exp System

- New nametag showing style

- New , Hud For Players

- Skin Selection from SA-MP

- Money System / Buy Weapons

- Drop Weapons

- New, Flood System

- New , Group Assign

- Gun license For Weapons

- Random Rule System For Money

Posted
No problem if you have problem with anything post it here and we will help you .

I really appreciate your help,

- New , Kill System

- New, GameMode Intro

- Leve / Exp System

- New nametag showing style

- New , Hud For Players

- Skin Selection from SA-MP

- Money System / Buy Weapons

- Drop Weapons

- New, Flood System

- New , Group Assign

- Gun license For Weapons

- Random Rule System For Money

Posted

is it possible to make a table with gui Buttons ?

and how ?

- New , Kill System

- New, GameMode Intro

- Leve / Exp System

- New nametag showing style

- New , Hud For Players

- Skin Selection from SA-MP

- Money System / Buy Weapons

- Drop Weapons

- New, Flood System

- New , Group Assign

- Gun license For Weapons

- Random Rule System For Money

Posted

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"

  

Posted

Iam understanding Tables Thank's to You Fahode ,

But if i want table for onClientGUIClick ?

- New , Kill System

- New, GameMode Intro

- Leve / Exp System

- New nametag showing style

- New , Hud For Players

- Skin Selection from SA-MP

- Money System / Buy Weapons

- Drop Weapons

- New, Flood System

- New , Group Assign

- Gun license For Weapons

- Random Rule System For Money

Posted

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 .

  

Posted

lol,

iam Going to Try doing it , and add it to Useful function lol ,

- New , Kill System

- New, GameMode Intro

- Leve / Exp System

- New nametag showing style

- New , Hud For Players

- Skin Selection from SA-MP

- Money System / Buy Weapons

- Drop Weapons

- New, Flood System

- New , Group Assign

- Gun license For Weapons

- Random Rule System For Money

Posted (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 by Guest

- New , Kill System

- New, GameMode Intro

- Leve / Exp System

- New nametag showing style

- New , Hud For Players

- Skin Selection from SA-MP

- Money System / Buy Weapons

- Drop Weapons

- New, Flood System

- New , Group Assign

- Gun license For Weapons

- Random Rule System For Money

Posted

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,

- New , Kill System

- New, GameMode Intro

- Leve / Exp System

- New nametag showing style

- New , Hud For Players

- Skin Selection from SA-MP

- Money System / Buy Weapons

- Drop Weapons

- New, Flood System

- New , Group Assign

- Gun license For Weapons

- Random Rule System For Money

Posted

Maybe you can do some thing like :

local xxx = guiGetText(Button) 
          if xxx == "Test[1]" then 
                         -- do some fuck 
end; 

  

Posted

Never Mined i will Talk to SolidSnake14,

- New , Kill System

- New, GameMode Intro

- Leve / Exp System

- New nametag showing style

- New , Hud For Players

- Skin Selection from SA-MP

- Money System / Buy Weapons

- Drop Weapons

- New, Flood System

- New , Group Assign

- Gun license For Weapons

- Random Rule System For Money

Posted
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 
  

Posted

Ok Thank's Ludo ,

i Hope i finsh My GameMode Lol,

- New , Kill System

- New, GameMode Intro

- Leve / Exp System

- New nametag showing style

- New , Hud For Players

- Skin Selection from SA-MP

- Money System / Buy Weapons

- Drop Weapons

- New, Flood System

- New , Group Assign

- Gun license For Weapons

- Random Rule System For Money

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...