Brad96 Posted August 13, 2013 Posted August 13, 2013 Help, I'm new to making my own script, and I know that I explain how optener Player position with getRoolElement .. and tried several things but nothing .. I might say? thanks function CrearCoche local x,y,z = getElementPosition( LocalPlayer ) Auto = createVehicle ( 411, x, y, z, 0, 0, 90, "BradFord" ) setVehicleColor (Auto, 255,0,0) end addEventHandler ("onResourceStart", getRootElement(), CrearCoche) Mi Nick En El Juego : Bs|Brad Mi Skype : fer_va_96
tosfera Posted August 13, 2013 Posted August 13, 2013 The onResourceStart doens´t know a localPlayer. The localPlayer is a predefined variable in the client side scripting. You can give everyone a vehicle with the onResourceStart. Since you only want to receive a car, try this command; addCommandHandler("giveMeVehicle", function ( thePlayer, command ) local x, y, z = getElementPosition( thePlayer ); local v = createVehicle(411, x, y, z, 0, 0, 90, "BradFord"); if ( v ) then setVehicleColor(v, 255, 0, 0); warpPedIntoVehicle(thePlayer, v); end end ); If you want to contact me directly concerning Advanced-Gaming, please contact me at [email protected]
Brad96 Posted August 13, 2013 Author Posted August 13, 2013 dont'work , but see addCommandHandler something is missing Mi Nick En El Juego : Bs|Brad Mi Skype : fer_va_96
tosfera Posted August 13, 2013 Posted August 13, 2013 lmao it doesn't? You're telling me that it doesn't work? Where did you add it, client or server side? Cause mine is server sided. edit; just tested it and it works like a charm! If you want to contact me directly concerning Advanced-Gaming, please contact me at [email protected]
Brad96 Posted August 13, 2013 Author Posted August 13, 2013 server side , and no , no work Mi Nick En El Juego : Bs|Brad Mi Skype : fer_va_96
Brad96 Posted August 13, 2013 Author Posted August 13, 2013 yes but I'm noob in this, donot exactly what vaen addCommandHandler addCommandHandler("V",thePlayer () getRootElement ) This ? our what Mi Nick En El Juego : Bs|Brad Mi Skype : fer_va_96
tosfera Posted August 13, 2013 Posted August 13, 2013 No, just copy the code into a server sided .lua file and restart your source, it works fine like this. If you want to contact me directly concerning Advanced-Gaming, please contact me at [email protected]
Brad96 Posted August 13, 2013 Author Posted August 13, 2013 work! I appreciate that, now can you tell me as to which line you got the player's position and that you gave? Mi Nick En El Juego : Bs|Brad Mi Skype : fer_va_96
isa_Khamdan Posted August 13, 2013 Posted August 13, 2013 work! I appreciate that, now can you tell me as to which line you got the player's position and that you gave? local x, y, z = getElementPosition( thePlayer ); local v = createVehicle(411, x, y, z, 0, 0, 90, "BradFord");
tosfera Posted August 14, 2013 Posted August 14, 2013 Just check out this function on the wiki (click on it) getElementPosition. it will give you an example how to use the function. If you want to contact me directly concerning Advanced-Gaming, please contact me at [email protected]
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now