Jump to content

aintaro

Members
  • Posts

    135
  • Joined

  • Last visited

Everything posted by aintaro

  1. Every player has he's own vehicle, so before spawning the vehicle i want the player to see a dummy version of the vehicle client dided before we spawn it server sided
  2. Thats exactly why I want to create a Vehicle client sided, I want the user to preview the car before he actually spawns it
  3. Ohh ok thats why..can you explain why that is?
  4. Hello guys, my vehicle color won't change to the color I want it to be, here is my simple command to spawn a vehicle with a certain color : function colorVehicle() local x,y,z = getElementPosition(getLocalPlayer()) -- get the position of the player x = x + 5 local vehicleShowz = createVehicle ( 491, x, y, z) setVehicleColor(vehicleShowz, 255, 0, 0) end addCommandHandler("spawnVehicle", colorVehicle) Anybody help? Thanks in addvance, Aintaro
  5. Alright, thanks a lot for sharing your opinion!
  6. Ello guys, Aintaro here with another question for you... How would you setup the saving for vehicle attributes? Option 1: xml file for every user with all the owned vehiclrd in it and attributes Option 2: using the mta database and save the attributes server sided for every player Option 3: sql Option 4: something else? Thanks in advance, Greetz aintaro
  7. Hello guys, The problem is I want my server sided function to finish before it executes the triggerClientEvent. Here is the code server sided: local vc1, vc2, vc3, vc4 function spawnOwnedVehicle(source, commandName, vehicleType) for y = 1, table.getn(playerVehicle) do outputChatBox(vehicleType) --if (playerVehicle[y] == tonumber(vehicleType)) then --found vehicle now load colors plx for x = 1, 5 do --outputChatBox(tostring(playerVehicle[y][x])) if (x == 2) then vc1 = playerVehicle[y][x] --loading colors outputChatBox(vc1) elseif (x == 3) then vc2 = playerVehicle[y][x] --loading colors elseif( x== 4) then vc3 = playerVehicle[y][x] --loading colors elseif (x== 5) then vc4 = playerVehicle[y][x] --loading colors end end --end end outputChatBox("Server send the trigger") triggerClientEvent ( "spawnPersonalVehicle", getRootElement(), spawnPersonalVehicle, vehicleType, vc1, vc2, vc3, vc4) --send the configs to the client so we can spawn this vehicle end addCommandHandler("spawnvehicles", spawnOwnedVehicle, source) code client sided : function spawnPersonalVehicle(localPlayer, pvehicleId, pvc1, pvc2 ,pvc3, pvc4) outputChatBox("Client got the server trigger") outputChatBox(pvehicleId) outputChatBox("pvc1"..pvc1) outputChatBox("pvc2"..pvc2) outputChatBox("pvc3"..pvc3) outputChatBox("pvc4"..pvc4) local x, y , z = getElementPosition(source) local personalVehicle = createVehicle ( getVehicleNameFromModel ( tonumber(pvehicleId) ), x + 5, y, z) setVehicleColor ( personalVehicle, tonumber(pvc1), tonumber(pvc2), tonumber(pvc3), tonumber(pvc4)) end addEvent("spawnPersonalVehicle", true) addEventHandler("spawnPersonalVehicle", root, spawnPersonalVehicle) output : Client got the server trigger [some parameters] Server send the trigger ps : No idea why lua tags are not working Thanks in advance, Greetz Aintaro
  8. Hello guys, Does anybody know how I run multiple clients on the same machine for testing purpose? thanks in advance, Aintaro
  9. Hello guys, When I place a ped with the mapeditor on the map, I want to adjust he's Z rotation, but it does nothing, the ped keeps facing teh same direction. Any help?
  10. Yeah thanks for letting me know, I did use it exactly like that
  11. Ok I got it, thanks man
  12. Hello guys, How would I write a simple dxdraw method where the font size is adjusted to the screen resolution? I know dxdraw has a optional scaleX and scaleY as arguments for the method but I just don't know how to write it. Thanks , aintaro
  13. The Interfaces look very nice man, keep up the great work
  14. ohh, I think i'm running 1.3
  15. @solidsnake: yes @jr10 : Oh to bad, i'll have to wait until 1.4 then, is there no cheap fix for it? cuz I hate when the server keeps saying event already running
  16. Hello mta people, How do I check if an event is already running? Thanks, Aintaro
  17. thanks arnold, thats what I wanted
  18. those would only tell if we hit a marker, but not a CERTAIN marker
  19. Hello guys, Lets say you have 100 markers on the map, how would you go and write a code that checks if a CERTAIN marker has been hit by the player? thanks in advance, greetz aintaro
  20. oh thats right, makes sense, thanks again mate, impressive knowledge of mta you have there up in your brain
  21. Hello guys, I was wondering what should be put client sided and what server sided? For example: is it safe to give a player money client sided when he gets in a mark? Can you set a player skin client sided? is that safe? I'm a bit confused on what to add client sided and what server sided. If sombody can clarifiy a bit It would help my server architecture a lot! Thanks in advance, Aintaro
  22. Omg I feel so stupid right now, *Shoot me in the head please*
  23. Hello guys, I've been trying to fix this error for a few days now and still nothing, it drives me crazy can sombody please clarify this: here is my client side code : function createPlayerList () -- Create the grid list shoppingList = guiCreateGridList ( 0.80, 0.10, 0.15, 0.60, true ) -- Create a players column in the list local column = guiGridListAddColumn( shoppingList, "Player", 0.85 ) if ( column ) then -- If the column has been created, fill it with players for id, playeritem in ipairs(getElementsByType("player")) do local row = guiGridListAddRow ( shoppingList ) guiGridListSetItemText ( shoppingList, row, column, getPlayerName ( playeritem ), false, false ) local playerName = guiGridListGetItemText ( shoppingList,0, 1) outputChatBox(playerName) end addEventHandler ( "onClientGUIClick", shoppingList, click ) end -- enable the players cursor (so they can select and click on the components) showCursor(true) -- set the input focus onto the GUI, allowing players (for example) to press 'T' without the chatbox opening guiSetInputEnabled(true) end addEventHandler ( "onClientResourceStart", getRootElement(), createPlayerList ) function click () local playerName = guiGridListGetItemText ( shoppingList, guiGridListGetSelectedItem ( shoppingList ), 1 ) ouputChatBox("name : " ..playerName) end here is my output of my debugscript :
×
×
  • Create New...