- 
                Posts21,935
- 
                Joined
- 
                Last visited
- 
                Days Won6
Everything posted by Castillo
- 
	That's the same script as his, you're trying to increase your post count I guess.
- 
	function getNearestMarkerToPosition(x, y) local minDistance=100000 for index, marker in ipairs(getElementsByType("marker")) do local mx, my = getElementPosition(marker) local distance = getDistanceBetweenPoints2D(x, y, mx, my) if (distance) then minDistance=distance return marker end end end No lo probe.
- 
	team1 = createTeam("Team 1", 255, 0, 0) setTeamFriendlyFire(team1, false)
- 
	addEventHandler("onPlayerJoin",root, function () bindKey(source,"z","down",fix) end) addEventHandler("onResourceStart",resourceRoot, function () for index, player in ipairs(getElementsByType("player")) do bindKey(player,"z","down",fix) end end) function fix (playerSource) local theVehicle = getPedOccupiedVehicle (playerSource) if (theVehicle and getVehicleController ( theVehicle ) == playerSource) then fixVehicle (theVehicle) local rx, ry, rz = getVehicleRotation ( theVehicle ) if ( rx > 110 ) and ( rx < 250 ) then local x, y, z = getElementPosition ( theVehicle ) setVehicleRotation ( theVehicle, rx + 180, ry, rz ) setElementPosition ( theVehicle, x, y, z + 2 ) end end end addCommandHandler ("fix", fix)
- 
	function zalogujGracza(nazwa, haslo) local query = dbQuery( funbox_db, "SELECT * FROM gracze WHERE nazwa=?", tostring(nazwa) ) local result, numrows, errmsg = dbPoll ( query, -1 ) if (numrows > 0) then outputChatBox(tostring(result[1].haslo)) end end
- 
	function zalogujGracza(nazwa,haslo) local dane=dbPoll(dbQuery( funbox_db, "SELECT haslo FROM gracze WHERE nazwa='"..nazwa.."'" ), -1) outputChatBox(tostring(dane[1].serial)) end addEvent("zalogujGracza",true) addEventHandler("zalogujGracza",root,zalogujGracza)
- 
	addCommandHandler("replace", function () setTimer(function () engineImportTXD(engineLoadTXD("skin.txd", ID), ID) engineReplaceModel(engineLoadDFF("skin.dff", 0), ID) end, 1000, 1) end) addCommandHandler("restore", function () engineRestoreModel(ID) end)
- 
	Wrong Xeno, when you're replacing something else than a vehicle the ID in engineLoadDFF must be 0. function onResourceStart() setTimer(function () engineImportTXD(engineLoadTXD("veg.txd", 22), 22) engineReplaceModel(engineLoadDFF("veg.dff", 0), 22) end, 1000, 1) end addEventHandler("onClientResourceStart", resourceRoot, onResourceStart)
- 
	addEventHandler("onPlayerJoin",root, function () bindKey(source,"z","down",fix) end) addEventHandler("onResourceStart",resourceRoot, function () for index, player in ipairs(getElementsByType("player")) do bindKey(player,"z","down",fix) end end) function fix (playerSource) local theVehicle = getPedOccupiedVehicle (playerSource) if (theVehicle and getVehicleController ( theVehicle ) == playerSource) then fixVehicle (theVehicle) end end addCommandHandler ("fix" , fix)
- 
	Did you replace the DFF (the model) too? because I think you didn't.
- 
	Vehicle mod: https://community.multitheftauto.com/index.php?p= ... ls&id=3391
- 
	andrex, el fuego no esta sincronizado.
- 
	function onEnter(thePlayer) -- Cuando entra a un vehiculo. if (getElementModel(source) == 407) then -- Si el modelo del vehiculo es del camion de Bomberos.. outputChatBox("Hola ".. getPlayerName(thePlayer) .."!",thePlayer,0,255,0) -- Le enviamos un mensaje al jugador. end end addEventHandler("onVehicleEnter",root,onEnter) -- Agregamos el evento para cuando un jugador entra a un vehiculo.
- 
	function onEnter(thePlayer) -- Cuando entra a un vehiculo. outputChatBox("Hola ".. getPlayerName(thePlayer) .."!",thePlayer,0,255,0) -- Le enviamos un mensaje al jugador. end addEventHandler("onVehicleEnter",root,onEnter) -- Agregamos el evento para cuando un jugador entra a un vehiculo.
- 
	Try this: local skip = {} function detachVehicle(thePlayer) if isPedInVehicle(thePlayer) and getPedOccupiedVehicleSeat(thePlayer) == 0 then local veh = getPedOccupiedVehicle(thePlayer) if getVehicleTowedByVehicle(veh) then detachTrailerFromVehicle(veh) outputChatBox("The trailer was detached.", thePlayer, 0, 255, 0) skip[veh] = true setTimer(function (veh) skip[veh] = nil end, 3000, 1, veh) else outputChatBox("There is no trailer...", thePlayer, 255, 0, 0) end end end addCommandHandler("detach", detachVehicle, false, false) addEventHandler("onTrailerAttach", root, function (theTruck) if skip[theTruck] then cancelEvent() end end)
- 
	No, because the result of math.random is already a number, not a table.
- 
	Your line: 14: setElementData ( source, 'Money', money+#grana ) My line 14: setElementData ( source, 'Money', money+grana )
- 
	function getAliveCount () local aliveAmount = 0 for i,v in ipairs (getAlivePlayers()) do aliveAmount = aliveAmount +1 end return aliveAmount end function rewardIfWin(source) local alive = getAliveCount() local money = getElementData ( source, 'Money' ) if ( isPedDead(source) ~= false ) and ( alive == 1 ) then local grana = math.random ( 100, 2000 ) setElementData ( source, 'Money', money+grana ) outputChatBox ( "#ABCDEF* #ffffffYou gain #00ff00" .. tostring(grana) .. "$ for winning the deathmatch !", source, 255, 255, 255, true ) end end function ifPlayerQuitSaveTheMoney(source) saveTheMoney = executeSQLInsert ( 'Money', getElementData ( source, 'Money' ) ) if ( type (saveTheMoney) == 'table' and #saveTheMoney == 1 ) then outputDebugString (getPlayerName(source) .. " money saved in SQL database.") end end addEventHandler ( "onPlayerQuit", getRootElement(), ifPlayerQuitSaveTheMoney )
- 
	Also check if the script has errors, if so, the compiler won't compile it (at least not the one I'm using).
- 
	Lol, nice one .

 
            
        