-
Posts
2,753 -
Joined
-
Last visited
-
Days Won
18
Everything posted by Captain Cody
-
Any one know it? I'm working on a vehicle over haul but cannot figure out the vehicle.txd ID.
-
Then what do I use to exact it into the client side? Never mind
-
Or better question How would I link to table values together Example - table.insert(ObjectsTable, name) table.insert(ObjectsTable, id) How would I link these together so when I put them into the gridlist it matches them up.
-
-- Server side -- function loadInventorym(account) local serial = getPlayerSerial ( client ) local InventoryTable = {} local InventoryTable2 = {} local player = client local xml = xmlLoadFile("@:Skins/Inventories/"..serial..".xml") for i, category in pairs(xmlNodeGetChildren(xml)) do local cName = xmlNodeGetAttribute(category, "Name") table.insert(InventoryTable, category) table.insert(InventoryTable, cName) for i, IN in pairs(xmlNodeGetChildren(category)) do local id, name = xmlNodeGetAttribute(IN, "Id"), xmlNodeGetAttribute(IN, "Name") table.insert(InventoryTable, name) table.insert(InventoryTable, id) end triggerClientEvent(player, "showInventorya", player, InventoryTable) end xmlUnloadFile(xml) end addEvent("ShowInventoryb", true) addEventHandler("ShowInventoryb", resourceRoot, loadInventorym) -- client side function showInventory(InventoryTable) guiGridListClear(Gridlist) for category, cName in pairs(InventoryTable) do local row = guiGridListAddRow(Gridlist) guiGridListSetItemText(Gridlist, row, 1, cName, true, false) for id, name in pairs(InventoryTable) do local row = guiGridListAddRow(Gridlist) guiGridListSetItemText(Gridlist, row, 1, "test2"..name, false, false) guiGridListSetItemText(Gridlist, row, 2, "test"..id, false, false) guiGridListSetItemText(Gridlist, row, 3, "test", false, false) showCursor(true) end end end How would I sort this? Correctly so that the correct items apear under the correct catagories?
-
Ok well I got it to apear on table, though I'm having some issues. #1, how would I add in catagories 'Correctly' Currently they are apearing as the Numbers 3 and 4 #2 how do I format the gridlist correctly Everything from the chart is appearing, but in the wrong format.
-
What do you mean by a loop?
-
Would any one happen to know the Vehicle.txd Id?
-
So use Table.insert for each object send it client side Then client side Use unpack correct? If so what do I use to create the initial table?
-
Oh that's easy, you just remove the math.random from the object, and replace that with the object id. Then it uses random cords but the same object.
-
Are the components separate from the stock ones?
-
Oh you wanted the object to spawn in different locations? I though you wanted certain object to spawn in set locations.
-
Why would you do all of this when you could just do it a lot simpler?
-
Hm... Well I guess that works to.
-
This again.. Number = {} -- Define at top of script Number[1] = 'PutNumberHere' Number[2] = 'PutNumberHere' Number[3] = 'PutNumberHere' Number[4] = 'PutNumberHere' Number[5] = 'PutNumberHere' Number[6] = 'PutNumberHere' Number[7] = 'PutNumberHere' Number[8] = 'PutNumberHere' Number[9] = 'PutNumberHere' Number[10] = 'PutNumberHere' Number[11] = 'PutNumberHere' Number[12] = 'PutNumberHere' Number[13] = 'PutNumberHere' Numberamount = 13 function RandomNumber () RandomNumber = math.random (1, Numberamount) Number = Number[Numberamount] end
-
Not quite sure about that one. But I have seen it done before.
-
Object = {} X = {} Y = {} Z = {} Object[1] = 1 X[1] = 1356.69360 Y[1] = 1546.84326,10.82031 Z[1] = 10.82031 -------- Object[2] = 3 X[2] = 1356.69360 Y[2] = 1546.84326,10.82031 Z[2] = 10.82031 ------- Object[3] = 1 X[3] = 1356.69360 Y[3] = 1546.84326,10.82031 Z[3] = 10.82031 ----- ItemCount = 3 function spawnLoot() randomItem = math.random (1, ItemCount) local object ,x, y, z = object[randomItem],X[randomItem],Y[randomItem],Z[randomItem] createObject ( object,x,y,z,0,0,0) end addEventHandler ( "onResourceStart", getRootElement(), spawnLoot) -- Put in random cords and object id, fill in your own -- As you add more objects you increase item account, and increase the number in [ ]
-
So do you want it to create all the objects at the same time or a random object?
-
What do you mean by members? Admins, moderators, other, all of the above?
-
Well what is the purpose of these objects, will they just stay there, move, Etc. Need this info to determine how you'd go about doing this.
-
Muting the sound I'm not quite sure, I'll have to search the wiki a bit 'Almost positive it is possible' But as for the rest of what you said playSound3D is played for everyone in range, and as for the volume, you can make it so it pulls the sound volume setting from the player and sets the 3d sounds volume according to that said volume.
-
Well I tested it with 5 computers each sending 20 players to the server. "Dear lord those computers were about to implode" 1 running local host, and the other 4 all running at different locations. And I was not going to use existing code, I was using it as an example to get started. And really I know enough XML to create the file, populate it with children, edit/remove bits, read the file, pull info from it and a bit more. But the issue I am having is just sending the info that has been pulled to the client side code, then putting that into a a gridlist. I know how to do it for one XML file for every player, but not individual files where the tables that have been pulled have to be assigned to individual names or serials.
-
Well that is because this only has one function which will only create one item.
-
https://wiki.multitheftauto.com/wiki/SetCameraMatrix https://wiki.multitheftauto.com/wiki/BindKey Bind Left right up Down, and make it change the cameras matrix by a set number each time you hit / hold a said key.
-
Well you could make the numbers that it chooses from whole numbers then divide the end number.
-
Well stability and performance is not an issue at all. Test server running on my laptop 'Not even close to as powerful as the servers host' can handle anything I throw at it without any lag. And the actual host is extremely stable and well maintained. So I'm going to assume either or would work. But the issue I'm having is actually fetching the items and sending them to the grid-list. I have barley any idea exactly where to begin as said in the first post. I made one a while ago for a skin selector but long since forgotten how. And even using code from something such as that would not work since it has to load a file that's set on the players serial instead of a base file that only has to load once.
