
ThePope
Members-
Posts
26 -
Joined
-
Last visited
Everything posted by ThePope
-
where is rootElement comming from? function bindTheKeys() unbindKey("mouse1", "down") bindKey("mouse1", "down", projectile) end addEventHandler ( "onClientPlayerSpawn", >>> rootElement <<<, bindTheKeys )
-
where is rootElement comming from? function bindTheKeys() unbindKey("mouse1", "down") bindKey("mouse1", "down", projectile) end addEventHandler ( "onClientPlayerSpawn", >>> rootElement <<<, bindTheKeys )
-
thnx 50p, i also took an example from your script to extend the one I already created ^^
-
thnx 50p, i also took an example from your script to extend the one I already created ^^
-
thanks, I'm gonna try some things with this info
-
thanks, I'm gonna try some things with this info
-
and this can also be done like this? oPlayerVehicle = createVehicle( 12, -2137, 656, 13 ) warpPedIntoVehicle( getLocalPlayer(), oPlayerVehicle )
-
and this can also be done like this? oPlayerVehicle = createVehicle( 12, -2137, 656, 13 ) warpPedIntoVehicle( getLocalPlayer(), oPlayerVehicle )
-
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!
-
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!
-
thanks for the fast answer, I'll look into it. It seems to be the function that I need for this.
-
thanks for the fast answer, I'll look into it. It seems to be the function that I need for this.
-
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!
-
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!
-
problem is solved, thank you very much! there appeared to be one "end" to many between an if and else ^^
-
problem is solved, thank you very much! there appeared to be one "end" to many between an if and else ^^
-
thank you for the tip, I'll look into it tomorrow. Found some things about debugging on the wiki so it should be interesting.
-
thank you for the tip, I'll look into it tomorrow. Found some things about debugging on the wiki so it should be interesting.
-
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!
-
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!
-
but how is that one level to deep? I used oCarXML as root element, which is still pointing at ?
-
but how is that one level to deep? I used oCarXML as root element, which is still pointing at ?
-
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
-
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
-
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?