Jump to content

I can't link 2 script to do a functions


Recommended Posts

I have edited an inventory in its entirety but what I don't know is how to make a link between one function or another, for example in this script I have the id of a key for the vehicle and I have implemented it in the car store so that when they buy it a Vehicle comes out of inventory but it doesn't work, what am I doing wrong?

Inventory

end	
	elseif itemID == 17 then
		 triggerServerEvent("checkCarKey",localPlayer,localPlayer,DBID,itemValue)

Carshop Script

setVehicleColor(vehicle, r1, g1, b1, r2, g2, b2)
		setElementData(vehicle, "Owner", source)
		local NewID = getFreeID()
		setElementData(vehicle, "ID", NewID)
		dbExec(db, "INSERT INTO VehicleList VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", NewID, getAccountName(getPlayerAccount(source)), Model, x-5, y+5, z, rz, color, "", 3, cost, 1000, 0)
		exports.Scripts_Dxmessages:outputDx ( source, "Compró este auto por: $"..cost, "success" )
		exports.itemID:givePlayerItem(player,40,1,id,17,0); ---- here is the item that I want to link to the car
		updateVehicleInfo(source)
		setElementData(vehicle, "ownercar", getAccountName(getPlayerAccount(source)))
		warpPedIntoVehicle ( source, vehicle )
		vv[vehicle] = setTimer(function(source)

 

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...