Jump to content

How to get the ID type of a pickup


..:D&G:..

Recommended Posts

No.. I want to know a function or something to GET the ID, and put it in another function, like createPickup = ( x, y, z, type, MODEL....) And I want to get the model ID so I can put it in MODEL

What I want to do is a command where you can make pickups, something like /addpickup [model] [message]

I done everything, but I want to know how to get the model, like a house pickup, or info, so I can make a local like local dimension = getElementDimension

Link to comment

Can't I do like a table where I can use the command like this:

SYNTAXA: /addpickup [model] [message]

/addpickup house This is a house pickup

And the table to look something like this:

local models = 
{ 
   house = PICKUP ID 
   info = PICKUP ID 
   dead = PICKUP ID 
   friends = PICKUP ID 
   bluehouse = PICKUP ID 
   arrow = PICKUP ID 
} 

I am not really good at tables and getting the data from one. What I want to do is to put the word instead of the ID in the command and to put in the mysql database the ID of the pickup. In other words I want to use words in command and numbers (IDs) in database

Link to comment

Sorry, but you lot don't get it.. I don't need the IDs, I want to know how to use a word in the cmd and numbers in the DB.

For exaple in the command I wirte /cmd house, and in the mysql database I want it to be a number (that I put in the table)

local models ={ 
    casav = 1273 
    casaa = 1272 
    sacbani = 1212 
    inima = 1240 
    armura = 1242 
    info = 1239 
    dolar = 1247 
    pastila = 1241 
    stea = 1247 
    gta3 = 1248 
    bomba = 1252 
    camera = 1253 
    craniu = 1254 
    bani = 1274 
    bluza = 1275 
    disk = 1277 
    craniu2 = 1313 
    statue = 1276 
    parasuta = 1310 
    sageata = 1318 
    drog = 1279 
} 

So, from this table I want to use the words instead othe PICKUP IDs, E.G. /cmdcreate gta3. All the pickups for me save in a mysql database, so in the DB i won't want to have the word, but I want the ID, which I've put on the table, but I don't know how to do this! How to use the word in the cmd and save in the DB as the ID ^

Link to comment
addCommandHandler ( "model", 
    function ( thePlayer, _, name ) 
        if ( models [ name ] ) then 
            outputChatBox ( "The model for: ".. name .." is: ".. models [ name ], thePlayer ) 
        end 
    end 
) 

Write "/model gta3" and it should output it's model.

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