Jump to content

Problem in Create Vehicle


ZuKi|R

Recommended Posts

Hello that such as are I hope that well, the reason for thispublication is that I want to create a vehicle through aguiCreateButton and a guiCreateEdit

 

---------------------------------------------------------------------------------------------------------------------------------

Client.lua 
--- Part of the function in the onClientGUIClick

------------------------------------------------------------------------------------------------------------------------------
 

elseif source == vehiclee then
local CreateCarro = guiGetText(vehiclees)
triggerServerEvent("CrearVehiculo", localPlayer, PlayerO,CreateCarro)

---------------------------------------------------------------------------------------------------------------------------------

Server.lua

function CrearCarroMod (nickC, CarroVehicle)

playeer = getPlayerFromName(nickC) 
createVehicle(getPlayerFromName(nickC), CarroVehicle)
outputChatBox("#FF0000"..getPlayerName(source).. " #00ff00Te Ha Dado Un "..CarroVehicle.."%", playeer, 255, 0, 0, true)
outputChatBox("#00ff00Has Dado Un "..CarroVehicle.."% #00ff00al Jugador #FF0000"..getPlayerName(playeer).."", source, 255, 0, 0, true)
end
addEvent("CrearVehiculo", true)
addEventHandler("CrearVehiculo", root, CrearCarroMod) 

------------------------------------------------------------------------------------------------------------------------

This is my code in the client and server.

Link to comment
  • Moderators

Please follow the createVehicle syntax

vehicle createVehicle ( int model, float x, float y, float z [, float rx, float ry, float rz, string numberplate, bool bDirection, int variant1, int variant2 ] )

https://wiki.multitheftauto.com/wiki/CreateVehicle

 

You have to fill in the model and it's position (x, y, z).

 

So for example:

createVehicle(400, 0, 0, 10)

This will create a vehicle with the skin/model 400 in the middle of the map.

 

 


And if that doesn't work, please check if that part of the code gets executed.

 

Edited by IIYAMA
Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...