Jump to content

jkub

Members
  • Posts

    342
  • Joined

  • Last visited

Everything posted by jkub

  1. 1) Is there any way I could make the in game screen render black and white ?(Maybe even control brightness or contrast) 2) I suppose the best route to render static effects on screen is to use dxLine functions. If so then what would be a good way to do so? 3) Is there a way to make a vehicle accelerate and follow a path without a player or ped being present to drive it? (Without forcing it using velocity changes) I would greatly appreciate any help Thanks
  2. [sarcasm]I want a full time role play scripter for my server and I want it NAO![/sarcasm]
  3. After you apply the super sticky adhesive to this make sure you apply some caulking around the edges
  4. I am currently working on a resource which will allow a ranked admin/mod system with input via commands and a compact gui. I am trying to use a gridlist for displaying the players names and their IPs. I can go through every player but names overwrite other names and things are being written to the wrong row in the gridlist. I see how all my gridlist rows may be named the same and I have made a table but I don't know how to specify them in a unique fashion. Please help function insertInfo() for k, v in pairs ( getElementsByType ( "player" ) ) do rowCount = rowCount + 1 rows[rowCount] = {} rows[rowCount].row = guiGridListAddRow ( playerList ) guiGridListSetItemText ( playerList, rows[rowCount].row, playerColumn, getPlayerName(v), false, false ) triggerServerEvent ( "requestIP", getLocalPlayer(), getLocalPlayer() ) end end function playerJoinHandler ( joinedPlayersName ) rowCount = rowCount + 1 rows[rowCount].row = guiGridListAddRow ( playerList ) guiGridListSetItemText ( playerList, rows[rowCount].row, playerColumn, joinedPlayersName, false, false ) triggerServerEvent ( "requestIP", getLocalPlayer(), getLocalPlayer() ) end function fillInIP ( requestingPlayer, IP ) guiGridListSetItemText ( playerList, rows[rowCount].row, IPColumn, IP, false, false ) end function playerChangedNickHandler ( changingPlayer, newNick ) guiGridListSetItemText ( playerList, rows[rowCount].row, playerColumn, newNick, false, false ) end
  5. OMG Thank you so much! That worked
  6. OMG Thank you so much! That worked
  7. I didn't know exactly where to put this so I tried my hand here. Now when I try to view the roadmap or changelog I can't and it just says mantis on those pages. Has the location for the roadmap changed? Where can I view the roadmap or changelog Please help thanks guys!
  8. I didn't know exactly where to put this so I tried my hand here. Now when I try to view the roadmap or changelog I can't and it just says mantis on those pages. Has the location for the roadmap changed? Where can I view the roadmap or changelog Please help thanks guys!
  9. I got it to work eventually and did the longer way of manually coding in the prices. Right now it works pretty good and I havent seen any errors in the debug box yet. later I was thinking about putting the prices in an xml file. Thanks guys ill be back:)
  10. I got it to work eventually and did the longer way of manually coding in the prices. Right now it works pretty good and I havent seen any errors in the debug box yet. later I was thinking about putting the prices in an xml file. Thanks guys ill be back:)
  11. I tried this to set the data guiGridListSetItemData ( wangList, row1, priceColumn, 86140 ) and this to retrieve it local price = guiGridListGetItemData ( wangList, row1, priceColumn ) then I try if ( money >= price ) then but that returns attempt to compare nil with number
  12. I tried this to set the data guiGridListSetItemData ( wangList, row1, priceColumn, 86140 ) and this to retrieve it local price = guiGridListGetItemData ( wangList, row1, priceColumn ) then I try if ( money >= price ) then but that returns attempt to compare nil with number
  13. Thanks That worked:) But... Now that I have done that in my guigrid list the price it just says 86140 instead of $86,140. is there a way I can have it displayed in the gui with the dollar sign and the comma with out it messing up the rest of the script when It comes to when I have to compare both the values again?
  14. Thanks That worked:) But... Now that I have done that in my guigrid list the price it just says 86140 instead of $86,140. is there a way I can have it displayed in the gui with the dollar sign and the comma with out it messing up the rest of the script when It comes to when I have to compare both the values again?
  15. it says at line 100 "attempt to compare string with number" ive already tried using if ( money >= tonumber(price) ) then but that just makes it return nil like I said function clickHandler ( button ) if source == shopWindow_Close then guiSetVisible ( shopWindow_Wang, false ) showCursor ( false ) removeEventHandler ( "onClientRender", getRootElement(), frameHandler ) destroyElement ( dummyCar ) elseif source == shopWindow_Purchase then local money = getPlayerMoney ( getLocalPlayer() ) if ( money >= price ) then--!!!in my script this line here is line 100 outputChatBox ( "You can afford these hax!", 0, 255, 0 ) else outputChatBox ( "You cannot afford these hax...", 255, 0, 0 ) end end end function gridClickHandler ( button ) row, column = guiGridListGetSelectedItem ( wangList ) local data = guiGridListGetItemText ( wangList, row, vehicleColumn ) local pricereturn = guiGridListGetItemText ( wangList, row, priceColumn ) if row then setElementModel ( dummyCar, getVehicleModelFromName ( tostring(data) ) ) price = tostring(pricereturn) outputChatBox ( price ) end end here is some gridlist code vehicleColumn = guiGridListAddColumn ( wangList, "Vehicle", 0.3 ) priceColumn = guiGridListAddColumn ( wangList, "Price", 0.2 ) row1 = guiGridListAddRow ( wangList ) guiGridListSetItemText ( wangList, row1, priceColumn, "$86,140", false, true ) at first I thought it would of been because I set the last boolean on setItemText to false which I think has somthing to do with rather the number is a number value so I set it to true... but still no luck
  16. it says at line 100 "attempt to compare string with number" ive already tried using if ( money >= tonumber(price) ) then but that just makes it return nil like I said function clickHandler ( button ) if source == shopWindow_Close then guiSetVisible ( shopWindow_Wang, false ) showCursor ( false ) removeEventHandler ( "onClientRender", getRootElement(), frameHandler ) destroyElement ( dummyCar ) elseif source == shopWindow_Purchase then local money = getPlayerMoney ( getLocalPlayer() ) if ( money >= price ) then--!!!in my script this line here is line 100 outputChatBox ( "You can afford these hax!", 0, 255, 0 ) else outputChatBox ( "You cannot afford these hax...", 255, 0, 0 ) end end end function gridClickHandler ( button ) row, column = guiGridListGetSelectedItem ( wangList ) local data = guiGridListGetItemText ( wangList, row, vehicleColumn ) local pricereturn = guiGridListGetItemText ( wangList, row, priceColumn ) if row then setElementModel ( dummyCar, getVehicleModelFromName ( tostring(data) ) ) price = tostring(pricereturn) outputChatBox ( price ) end end here is some gridlist code vehicleColumn = guiGridListAddColumn ( wangList, "Vehicle", 0.3 ) priceColumn = guiGridListAddColumn ( wangList, "Price", 0.2 ) row1 = guiGridListAddRow ( wangList ) guiGridListSetItemText ( wangList, row1, priceColumn, "$86,140", false, true ) at first I thought it would of been because I set the last boolean on setItemText to false which I think has somthing to do with rather the number is a number value so I set it to true... but still no luck
  17. I would usually know how to convert a string into a number normally using tostring or tonumber but now I am getting data from a gui gridlist I have created and now I cannot do anything. I am storing a "price" in one of the grid list rows on the "priceColumn" and I use guiGridListGetItemText to retrieve the price that is displayed inside the row on the price column. It returns a string So I am able to output the correct thing to the chatbox but when I try to take it convert it to a number using tonumber it comes back as nil. Attempt to compare nil with number is what I get. here is some of my code function clickHandler ( button ) if source == shopWindow_Close then guiSetVisible ( shopWindow_Wang, false ) showCursor ( false ) removeEventHandler ( "onClientRender", getRootElement(), frameHandler ) destroyElement ( dummyCar ) elseif source == shopWindow_Purchase then local money = getPlayerMoney ( getLocalPlayer() ) if ( money >= price ) then outputChatBox ( "You can afford these hax!", 0, 255, 0 ) else outputChatBox ( "You cannot afford these hax...", 255, 0, 0 ) end end end function gridClickHandler ( button ) row, column = guiGridListGetSelectedItem ( wangList ) local data = guiGridListGetItemText ( wangList, row, vehicleColumn ) local pricereturn = guiGridListGetItemText ( wangList, row, priceColumn ) if row then setElementModel ( dummyCar, getVehicleIDFromName ( tostring(data) ) ) price = tostring(pricereturn) outputChatBox ( price ) end end Btw I am trying yet again to make a little vehicle shop type deal. So you might know where I might be going Please help
  18. I would usually know how to convert a string into a number normally using tostring or tonumber but now I am getting data from a gui gridlist I have created and now I cannot do anything. I am storing a "price" in one of the grid list rows on the "priceColumn" and I use guiGridListGetItemText to retrieve the price that is displayed inside the row on the price column. It returns a string So I am able to output the correct thing to the chatbox but when I try to take it convert it to a number using tonumber it comes back as nil. Attempt to compare nil with number is what I get. here is some of my code function clickHandler ( button ) if source == shopWindow_Close then guiSetVisible ( shopWindow_Wang, false ) showCursor ( false ) removeEventHandler ( "onClientRender", getRootElement(), frameHandler ) destroyElement ( dummyCar ) elseif source == shopWindow_Purchase then local money = getPlayerMoney ( getLocalPlayer() ) if ( money >= price ) then outputChatBox ( "You can afford these hax!", 0, 255, 0 ) else outputChatBox ( "You cannot afford these hax...", 255, 0, 0 ) end end end function gridClickHandler ( button ) row, column = guiGridListGetSelectedItem ( wangList ) local data = guiGridListGetItemText ( wangList, row, vehicleColumn ) local pricereturn = guiGridListGetItemText ( wangList, row, priceColumn ) if row then setElementModel ( dummyCar, getVehicleIDFromName ( tostring(data) ) ) price = tostring(pricereturn) outputChatBox ( price ) end end Btw I am trying yet again to make a little vehicle shop type deal. So you might know where I might be going Please help
  19. Hy its been a while since I have did any mta projects Id like to get back in the groove. I have updated to 1.0.3 both client and server but now when I connect to my freeroam server I just get a black screen. Even when I open the spawn window and try to spawn somewhere it does not work. Im just stuck in the black. Can someone please help me
  20. jkub

    Writing a file

    Thank You so much that worked Wonderfuly! Ill get back and see what I can do
  21. jkub

    Writing a file

    Thanks but what if I want to write it to an lua?
  22. jkub

    Writing a file

    I tried that it didnt really work though... It was doing the same thing as before. Also the processed file message only appears one time does that mean its not looping through all the vehicles correctly? May there be a fault in my other part of the code? local carCount = 0 maxCarCount = 50 car = {} function cmdAddVehicle ( player, cmd, vehicleName ) if cmd == "add" then if selMarker then outputChatBox ( "You are already editing a vehicle... save your current", player, 255, 0, 0 ) else local pX, pY, pZ = getElementPosition ( player ) local pRZ = getPedRotation ( player ) if carCount <= maxCarCount then car[carCount] = {} car[carCount].car = createVehicle ( getVehicleModelFromName(vehicleName), pX, pY + 5, pZ + 1, 0, 0, pRZ ) local x, y, z = getElementPosition ( car[carCount].car ) selMarker = createMarker ( x, y, z, "arrow", 2, 255, 255, 0, 125, getRootElement() ) attachElements ( selMarker, car[carCount].car, 0, 0, 5 ) if car[carCount].car then outputChatBox ( "You have created a " ..vehicleName, player, 0, 255, 0 ) end end end end end addCommandHandler ( "add", cmdAddVehicle ) addCommandHandler ( "setstepping", function ( player, cmd, newStepping ) stepping = tonumber(newStepping) outputChatBox ( "Stepping set to " ..newStepping, player, 0, 255, 0 ) end ) function saveTheCar ( player, cmd ) destroyElement ( selMarker ) selMarker = nil outputChatBox ( "Vehicle Placed!", player, 0, 255, 0 ) end addCommandHandler ( "savecar", saveTheCar ) addCommandHandler ( "save", function ( player, cmd, name ) if cmd == "save" then if selMarker then outputChatBox ( "You are currently editing a vehicle you must save the vehicle before you can save the map", player, 255, 0, 0 ) else file = fileCreate ( "output/" ..name.. ".lua" ) fileWrite ( file, "--File Generated with Dr.PhillyBlunt's Experimental Vehicle Mapper and Mapped by " ..getPlayerName(player).. "\r\n" ) fileWrite ( file, "local car = {} \r\n" ) local count = 0 for _,v in pairs ( car ) do if v.car then count = count + 1 local vx, vy, vz = getElementPosition ( v.car ) local vehName = getVehicleName ( v.car ) local realID = getVehicleModelFromName ( vehName ) fileWrite ( file, "car[" ..count.. "] = createVehicle ( " ..realID.. ", " ..vx.. ", " ..vy.. ", " ..vz.. " ) -- " ..vehName.. " \r\n" ) outputChatBox ( "File processed", player, 0, 255, 0 ) end end fileClose ( file ) end end end )
  23. jkub

    Writing a file

    I am working on a script for adding cars moving them around and saving them to a seperate lua file. My problem here is that every time I save the map it only saves one of the vehicles. I may have placed several vehicles on the map to save but it will only save the last one I edited and only write that single car to the file please help addCommandHandler ( "save", function ( player, cmd, name ) if cmd == "save" then if selMarker then outputChatBox ( "You are currently editing a vehicle you must save the vehicle before you can save the map", player, 255, 0, 0 ) else file = fileCreate ( "output/" ..name.. ".lua" ) fileWrite ( file, "--File Generated with Dr.PhillyBlunt's Experimental Vehicle Mapper and Mapped by " ..getPlayerName(player).. "\r\n" ) for k,v in pairs ( car ) do if car[k].car then local vx, vy, vz = getElementPosition ( car[k].car ) local vehName = getVehicleName ( car[k].car ) local realID = getVehicleModelFromName ( vehName ) fileWrite ( file, "car[" ..#car.. "] = createVehicle ( " ..realID.. ", " ..vx.. ", " ..vy.. ", " ..vz.. " ) -- " ..vehName.. " \r\n" ) outputChatBox ( "File processed", player, 0, 255, 0 ) end end fileClose ( file ) end end end )
  24. Ya I changed it up yesterday to where the markers where the markers were client side. Of course that does lead to many client>server interactions. I hope it does not end up like it was when I had like 6 people playing with it there were stuck markers everywhere. Is there any way to get the position of the end of the players gun barrel when he is pointing it?
×
×
  • Create New...