Jump to content

JamieSA

Members
  • Posts

    11
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

JamieSA's Achievements

Square

Square (6/54)

2

Reputation

  1. JamieSA

    table data

    is this man just asking for a simple loop through his data table? Just loop through your data table and do what you need to do with each row function mytrigger() local bases = { {2412.8,92,26.47,1830.7,-1930.1,2955.6001,"garaza","playerserial"}, {1835.7,-1930.1,2955.6001,2412.8,92,26.40,"garaza2","playerserial"}, } for key, value in ipairs(bases) do local x,y,z,x1,y1,z1,password,ownerserial = value[1],value[2],value[3],value[4],value[5],value[6],value[7],value[8] -- do your workings with each row here outputConsole(tostring(ownerserial)) end end addCommandHandler ( "mytrigger", mytrigger ) I've added a command handler so you can output the result to the console for testing yourself. When outputting to the console be sure to use tostring() for any value that is not a string already
  2. Upon re-reading what he said, I agree that's what he probably wants, the user to be able to type /help "the message" and for it then to be delivered to admins only.
  3. JamieSA

    Car colors

    Can someone confirm... using setVehicleColor() can I use whatever colour I want in RGB format as I cannot find anything clear on this.
  4. I have not tested this, but you should read about ACL Groups and ACL Lists In your case i think you might be looking for something along these lines... function helpMe() -- your code hre end addCommandHandler ( "help", helpMe) And then in: <acl name="Default"> <right name="command.start" access="false" /> <right name="command.stop" access="false" /> <right name="command.stopall" access="false" /> ...etc etc... </acl> Add: <right name="command.help" access="false" /> Might not be spot on... but along those lines
  5. Thankyou for your reply
  6. solved this myself... getAllAccountData saved me here
  7. try and explain better what your trying to do?
  8. Server: ------------------------------------------------------------------------------------ -- Get Garage function - used to fill and refresh personal vehicle list ------------------------------------------------------------------------------------ addEvent("getGarage", true) function getGarage ( thePlayer ) playerAccount = getPlayerAccount(thePlayer) dataTable = {} dataTable[10] = getAccountData(playerAccount, "activePV") for i=0,9 do id = getAccountData(playerAccount, "personal_vehicle_"..i) dataTable[i] = id end for k,v in ipairs(dataTable) do setElementData(source, "personal_vehicle_"..k, v) end outputConsole("--- Vehicle list returned from server. ---") triggerClientEvent("getGarageCallback", thePlayer, dataTable) end addEventHandler ( "getGarage", getRootElement(), getGarage ) ------------------------------------------------------------------------------------ Client: ------------------------------------------------------------------------------------ -- Get garage callback ------------------------------------------------------------------------------------ addEvent("getGarageCallback", true) function getGarageCallback(theGarage) if(theGarage)then outputConsole("--- Vehicle list received by client. ---") end end addEventHandler ( "getGarageCallback", getRootElement(), getGarageCallback ) ------------------------------------------------------------------------------------ works the first time... but never again whats going on??
  9. Hi, I've been working on a personal vehicle script recently and have run into a problem... in my GUI panel, I have a grid list that is populated by calling a function that pulls the user data "personal_vehicle_x" from the internal DB and sets it into element data with the same name and displays it in the list.... it works at first, when the panel is first initiated by pressing the bound key (num_add) (i call the server function each time the corresponding key is pressed to ensure the list is updated)... I can see the data changing in the database, however, the code accessing it is not getting the new result... is there something fundamental I am missing? and should I be adding custom tables for this? or is it ok to make use of the user data table? Also... the data updates upon the player logging in, where I am also calling the function initially
  10. JamieSA

    Please help!!

    I know this is probably a simple thing, but I've downloaded a car skin and was given the files: infernus.txd, infernus1.txd, infernus2.txd, infernus3.txd, infernus4.txd, infernus.dff the infernus appears to be the base and the numbered file the paint jobs... I can get either working alone... but obviously they dont look right... what am i missing here? what do i do with the numbered files?' Any help would be much appreciated, i've been stuck on this for hours. thanks!
×
×
  • Create New...