Jump to content

ThePope

Members
  • Posts

    26
  • Joined

  • Last visited

Everything posted by ThePope

  1. where is rootElement comming from? function bindTheKeys() unbindKey("mouse1", "down") bindKey("mouse1", "down", projectile) end addEventHandler ( "onClientPlayerSpawn", >>> rootElement <<<, bindTheKeys )
  2. where is rootElement comming from? function bindTheKeys() unbindKey("mouse1", "down") bindKey("mouse1", "down", projectile) end addEventHandler ( "onClientPlayerSpawn", >>> rootElement <<<, bindTheKeys )
  3. thnx 50p, i also took an example from your script to extend the one I already created ^^
  4. thnx 50p, i also took an example from your script to extend the one I already created ^^
  5. thanks, I'm gonna try some things with this info
  6. thanks, I'm gonna try some things with this info
  7. and this can also be done like this? oPlayerVehicle = createVehicle( 12, -2137, 656, 13 ) warpPedIntoVehicle( getLocalPlayer(), oPlayerVehicle )
  8. and this can also be done like this? oPlayerVehicle = createVehicle( 12, -2137, 656, 13 ) warpPedIntoVehicle( getLocalPlayer(), oPlayerVehicle )
  9. Hello all, I feel like I'm spamming a little bit here, or I wan't so many unusual things I am looking for a way to spawn a player into or inside a vehicle that he/she just spawned. Is this possible? 'Cause I can't find anything about this on the wiki nor the forum. thanks in advance!
  10. Hello all, I feel like I'm spamming a little bit here, or I wan't so many unusual things I am looking for a way to spawn a player into or inside a vehicle that he/she just spawned. Is this possible? 'Cause I can't find anything about this on the wiki nor the forum. thanks in advance!
  11. thanks for the fast answer, I'll look into it. It seems to be the function that I need for this.
  12. thanks for the fast answer, I'll look into it. It seems to be the function that I need for this.
  13. Hello all, I was wondering if there is an event for when a player moves. (regardless is it is train, car, on foot whatever is possible). I want to use this to create a "label" at the bottom of the screen to display the current cooridinates. (specific, like: X = -2175.034896412 Y = 656.01654798 Z = 13 or something like that) Can anyone point me in the right direction or are there any pre-existing resources available for this? I have been searching all morning but there doesn't seem to exist anyhing that does this kind of thing. Thanks in advance!
  14. Hello all, I was wondering if there is an event for when a player moves. (regardless is it is train, car, on foot whatever is possible). I want to use this to create a "label" at the bottom of the screen to display the current cooridinates. (specific, like: X = -2175.034896412 Y = 656.01654798 Z = 13 or something like that) Can anyone point me in the right direction or are there any pre-existing resources available for this? I have been searching all morning but there doesn't seem to exist anyhing that does this kind of thing. Thanks in advance!
  15. problem is solved, thank you very much! there appeared to be one "end" to many between an if and else ^^
  16. problem is solved, thank you very much! there appeared to be one "end" to many between an if and else ^^
  17. thank you for the tip, I'll look into it tomorrow. Found some things about debugging on the wiki so it should be interesting.
  18. thank you for the tip, I'll look into it tomorrow. Found some things about debugging on the wiki so it should be interesting.
  19. well, it changed the situation. Now the script won't react to the event when I walk into the sphere I created. I'm going to look into it, but not right now. Thanks for the help so far!
  20. well, it changed the situation. Now the script won't react to the event when I walk into the sphere I created. I'm going to look into it, but not right now. Thanks for the help so far!
  21. but how is that one level to deep? I used oCarXML as root element, which is still pointing at ?
  22. but how is that one level to deep? I used oCarXML as root element, which is still pointing at ?
  23. sorry, my bad. I changed the code to look for the tag but still nothing. outputChatBox( "Client: Creating car grid" ) oCarList = guiCreateGridList ( 0.03 , 0.07, 0.4, 0.8, true, oShopGUI ) oColumnCarName = guiGridListAddColumn( oCarList, "Car", 0.5 ) oColumnPrice = guiGridListAddColumn( oCarList, "Price", 0.3 ) oCarXml = xmlLoadFile("data\\cars.xml") if ( oCarXml ) then outputChatBox( "Client: Cars.xml loaded" ) --local oCarListRow = guiGridListAddRow( oCarList ) --guiGridListSetItemText( oCarList, oCarListRow, 1, "test", false, false ) --guiGridListSetItemText( oCarList, oCarListRow, 2, "123", false, false ) local iCarIndex = 0; while ( xmlFindChild( oCarXML, "car", iCarIndex ) ~= false ) do outputChatBox( "Client: message 2" ) local oCar = xmlFindChild( oCarXML, "car", iCarIndex ) local iCarID = xmlNodeGetAttribute( oCar, "id" ) local iCarPrice = xmlNodeGetAttribute( oCar, "price" ) local sCarName = getVehicleNameFromModel( iCarID ) local oCarListRow = guiGridListAddRow( oCarList ) guiGridListSetItemText( oCarList, oCarListRow, 1, ""..sCarName.."", false, false ) guiGridListSetItemText( oCarList, oCarListRow, 2, ""..iCarPice.."", false, false ) iCarIndex = iCarIndex + 1 end outputChatBox( "Client: cars added to list." ) else outputChatBox( "Client: Fatal error while loading xml file." ) end
  24. sorry, my bad. I changed the code to look for the tag but still nothing. outputChatBox( "Client: Creating car grid" ) oCarList = guiCreateGridList ( 0.03 , 0.07, 0.4, 0.8, true, oShopGUI ) oColumnCarName = guiGridListAddColumn( oCarList, "Car", 0.5 ) oColumnPrice = guiGridListAddColumn( oCarList, "Price", 0.3 ) oCarXml = xmlLoadFile("data\\cars.xml") if ( oCarXml ) then outputChatBox( "Client: Cars.xml loaded" ) --local oCarListRow = guiGridListAddRow( oCarList ) --guiGridListSetItemText( oCarList, oCarListRow, 1, "test", false, false ) --guiGridListSetItemText( oCarList, oCarListRow, 2, "123", false, false ) local iCarIndex = 0; while ( xmlFindChild( oCarXML, "car", iCarIndex ) ~= false ) do outputChatBox( "Client: message 2" ) local oCar = xmlFindChild( oCarXML, "car", iCarIndex ) local iCarID = xmlNodeGetAttribute( oCar, "id" ) local iCarPrice = xmlNodeGetAttribute( oCar, "price" ) local sCarName = getVehicleNameFromModel( iCarID ) local oCarListRow = guiGridListAddRow( oCarList ) guiGridListSetItemText( oCarList, oCarListRow, 1, ""..sCarName.."", false, false ) guiGridListSetItemText( oCarList, oCarListRow, 2, ""..iCarPice.."", false, false ) iCarIndex = iCarIndex + 1 end outputChatBox( "Client: cars added to list." ) else outputChatBox( "Client: Fatal error while loading xml file." ) end
  25. Hello, I have a problem that is starting to give me a headache. I'm learing Lua Scripting, so I took some scripts as examples and tried to build a carshop. Basic idea seems simple to me, list al the cars from an xml file and then, when a player clicks buy, compare his/her money to the costs and spawn the car. The shops are created without a fuss, also from an xml file. But when I do so with the cars, it seems to think there are no entries in the xml file?!. Here is my a piece of my xml file: and this is the list function: outputChatBox( "Client: Creating car grid" ) oCarList = guiCreateGridList ( 0.03 , 0.07, 0.4, 0.8, true, oShopGUI ) oColumnCarName = guiGridListAddColumn( oCarList, "Car", 0.5 ) oColumnPrice = guiGridListAddColumn( oCarList, "Price", 0.3 ) oCarXml = xmlLoadFile("data\\cars.xml") if ( oCarXml ) then outputChatBox( "Client: Cars.xml loaded" ) --local oCarListRow = guiGridListAddRow( oCarList ) --guiGridListSetItemText( oCarList, oCarListRow, 1, "test", false, false ) --guiGridListSetItemText( oCarList, oCarListRow, 2, "123", false, false ) local iCarIndex = 0; while ( xmlFindChild( oCarXML, "vehicle", iCarIndex ) ~= false ) do outputChatBox( "Client: message 2" ) local oCar = xmlFindChild( oCarXML, "vehicle", iCarIndex ) local iCarID = xmlNodeGetAttribute( oCar, "id" ) local iCarPrice = xmlNodeGetAttribute( oCar, "price" ) local sCarName = getVehicleNameFromModel( iCarID ) local oCarListRow = guiGridListAddRow( oCarList ) guiGridListSetItemText( oCarList, oCarListRow, 1, ""..sCarName.."", false, false ) guiGridListSetItemText( oCarList, oCarListRow, 2, ""..iCarPice.."", false, false ) iCarIndex = iCarIndex + 1 end outputChatBox( "Client: cars added to list." ) as you can see, I also tried adding cars manually to the list and that worked fine. Can anyone help me, or point me in the right direction?
×
×
  • Create New...