-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
Have you checked if the script is set to server side?
-
I also have the module in the mtaserver.conf, but it doesn't load when I start the server, I have to write "load mta_mysql.dll"
-
Indeed, I would said either he didn't load the MySQL module or he put the script as client side.
-
Do you have Ryden's MySQL module loaded? and is the script set to server side?
-
local Timer = {} g_ResRoot = getResourceRootElement(getThisResource()) g_Root = getRootElement() g_PlayerData = {} g_VehicleData = {} function getting (PlayerSource, rh,gh,bh,r1,g1,b1,r2,g2,b2,r3,g3,b3,r4,g4,b4,rand ) --outputChatBox("getting started.") if Timer[PlayerSource] then killTimer( Timer[PlayerSource] ) end --rand = tonumber(rand) if rand then Timer[PlayerSource] = setTimer( function ( playerVehicle ) local vehicle = getPedOccupiedVehicle( PlayerSource ) if vehicle then --setVehicleOverrideLights ( vehicle, 2 ) setVehicleHeadLightColor ( vehicle, rh,gh,bh) setVehicleColor ( vehicle,r1,g1,b1,r2,g2,b2,r3,g3,b3,r4,g4,b4 ) end end ,1000, 0, playerSource, rh,gh,bh,r1,g1,b1,r2,g2,b2,r3,g3,b3,r4,g4,b4 ) end end addEvent( "getting", true ) addEventHandler( "getting", getRootElement(), getting ) function stopwhileupdate(PlayerSource) if Timer[PlayerSource] then killTimer( Timer[PlayerSource] ) Timer[PlayerSource] = nil end end addEvent( "stopwhileupdate", true ) addEventHandler( "stopwhileupdate", getRootElement(), stopwhileupdate ) function removeStateOnQuit() killTimer( Timer[source] ) Timer[source] = nil end addEventHandler( "onPlayerQuit", getRootElement(), removeStateOnQuit ) g_RPCFunctions = { addVehicleUpgrade = { option = 'upgrades', descr = 'Adding/removing upgrades' }, removePedFromVehicle = true, removeVehicleUpgrade = { option = 'upgrades', descr = 'Adding/removing upgrades' }, setElementAlpha = { option = 'alpha', descr = 'Changing your alpha' }, setElementPosition = true, setElementInterior = true, --setVehicleColor = true, setVehicleHeadLightColor = true, setVehicleOverrideLights = { option = 'lights', descr = 'Forcing lights' }, setVehiclePaintjob = { option = 'paintjob', descr = 'Applying paintjobs' }, setVehicleRotation = true } g_OptionDefaults = { alpha = true, time = { set = true, freeze = true } } function getOption(optionName) local option = get(optionName:gsub('%.', '/')) if option then if option == 'true' then option = true elseif option == 'false' then option = false end return option end option = g_OptionDefaults for i,part in ipairs(optionName:split('.')) do option = option[part] end return option end addEvent('onServerCall', true) addEventHandler('onServerCall', g_Root, function(fnName, ...) local fnInfo = g_RPCFunctions[fnName] if fnInfo and ((type(fnInfo) == 'boolean' and fnInfo) or (type(fnInfo) == 'table' and getOption(fnInfo.option))) then local fn = _G for i,pathpart in ipairs(fnName:split('.')) do fn = fn[pathpart] end fn(...) elseif type(fnInfo) == 'table' then errMsg(fnInfo.descr .. ' is not allowed', source) end end ) function clientCall(player, fnName, ...) triggerClientEvent(player, 'onClientCall', g_ResRoot, fnName, ...) end function startserver() triggerClientEvent( "start", getRootElement() ) end addEventHandler( "onResourceStart", resourceRoot, startserver) Not sure if it'll work.
-
You're welcome.
-
Ejemplo: function multiplicar(numero1, numero2) if (type(numero1) == "number" and type(number2) == "number") then return numero1 * numero2 end end outputChatBox(tostring(multiplicar(5, 5)))
-
GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Memo = {} GUIEditor_Grid = {} GUIEditor_Window[1] = guiCreateWindow(0.2884,0.2591,0.3909,0.6536,"Teleporter by Twisted",true) guiSetVisible(GUIEditor_Window[1],false) showCursor(false) GUIEditor_Grid[1] = guiCreateGridList(0.0562,0.1116,0.6161,0.8167,true,GUIEditor_Window[1]) guiGridListSetSelectionMode(GUIEditor_Grid[1],1) guiGridListAddColumn(GUIEditor_Grid[1],"Teleports",0.5) GUIEditor_Button[1] = guiCreateButton(0.6854,0.8327,0.2884,0.0916,"Close",true,GUIEditor_Window[1]) guiSetProperty(GUIEditor_Button[1],"NormalTextColor","FF00FF00") GUIEditor_Memo[1] = guiCreateMemo(0.6985,0.1355,0.2659,0.6713,"This teleporter script was made by Twisted and should not be shared without concent Copyrighted(C) Double click the Teleporter u wish to Travel too \"{SMILIES_PATH}/icon_smile.gif\" alt=\"\" title=\"Smile\" /> ",true,GUIEditor_Window[1]) guiMemoSetReadOnly(GUIEditor_Memo[1],true) function open() if (guiGetVisible(GUIEditor_Window[1],true)) then guiSetVisible(GUIEditor_Window[1],false) showCursor(false) else guiSetVisible(GUIEditor_Window[1],true) showCursor(true) addTeleports() end end bindKey("F4","down",open) function close() if (source == GUIEditor_Button[1]) then guiSetVisible(GUIEditor_Window[1],false) showCursor(false) end end addEventHandler("onClientGUIClick",getRootElement(),close) function addTeleports() guiGridListClear(GUIEditor_Grid[1]) if (guiGetVisible(GUIEditor_Window[1]) == true) then local file = xmlLoadFile("Teleports.xml") if file then for i,v in ipairs(xmlNodeGetChildren(file)) do local name = xmlNodeGetAttribute(v,"name") local row = guiGridListAddRow(GUIEditor_Grid[1]) guiGridListSetItemText (GUIEditor_Grid[1], row, 1, tostring(name), false, true) end end end end function teleport() local row,col = guiGridListGetSelectedItem(source) if (row and col and row ~= -1 and col ~= -1) then local name = guiGridListGetItemText(source, row, 1) local file = xmlLoadFile("Teleports.xml") if file then for i,v in ipairs(xmlNodeGetChildren(file)) do local teleportName = xmlNodeGetAttribute(v,"name") if (teleportName == name) then local poX = xmlNodeGetAttribute(v,"posX") local poY = xmlNodeGetAttribute(v,"posY") local poZ = xmlNodeGetAttribute(v,"posZ") setElementPosition(localPlayer, tonumber(poX), tonumber(poY), tonumber(poZ)) end end end end end addEventHandler("onClientGUIDoubleClick",GUIEditor_Grid[1],teleport,false)
-
What do you mean? you can replace current vehicle models, but you can't create new ID's. P.S: Everyone can replace a vehicle, just check the wiki, there's a example of how to replace a "Euros". https://wiki.multitheftauto.com/wiki/Cli ... _functions
-
Weapon mods: https://community.multitheftauto.com/index.php?p= ... ls&id=3610 https://community.multitheftauto.com/index.php?p= ... ls&id=3611
-
Lo encontre .
-
I meant this: function respawnVehicles() outputChatBox("*Empty vehicles will be respawned in 10 seconds.", root, 255, 255, 0) setTimer(function () local vehicles = getElementsByType ( "vehicle" ) outputChatBox("*Empty Vehicles has been respawned.", root, 0, 220, 20, true) for k, vehicle in ipairs ( vehicles ) do if isEmpty( vehicle ) then respawnVehicle ( vehicle ) end end end, 10000, 1) end setTimer(respawnVehicles, 180000, 0) function isEmpty( vehicle ) local passengers = getVehicleMaxPassengers( vehicle ) if (type( passengers ) == 'number') then for seat = 0, passengers do if getVehicleOccupant( vehicle, seat ) then return false end end end return true end
-
I don't get anything of what do you say, mind explaining EXACTLY what do you want? When you use the function "kickPlayer" you must add the resource to the "ACL.xml" in group "Admin".
-
addEventHandler("onPlayerJoin",root, function () bindKey(source,"F1","down",randomCar) end) addEventHandler("onResourceStart",resourceRoot, function () for index, player in ipairs(getElementsByType("player")) do bindKey(player,"F1","down",randomCar) end end) function randomCar(player) local veh = getPedOccupiedVehicle(player) if (veh) then local x,y,z = getElementPosition(veh) setElementModel (veh, carids[math.random(#carids)]) setElementPosition (veh, x, y, z+2) end end
-
You're welcome. P.S: Name sounds familiar, but I can't remember you
-
setElementFrozen(getPedOccupiedVehicle ( thePlayer ), true) setTimer(setElementFrozen,5000,1,getPedOccupiedVehicle ( thePlayer ), false) -- Unfreeze after 5 seconds.
-
I've already tried, but it doesn't work as I said before, because it's a built-on command.
-
I doubt you can, you can kick the player with: kickPlayer But I don't you can make the player execute the command "disconnect", as it's a built-on command.
-
You're trying to get position of something that doesn't exists yet? xW,yW,zW = getElementPosition(wood) xWR, yWR, zWR = getElementRotation(wood) setTimer(function(xW,yW,zW,xWR,yWR,zWR) wood = createObject ( 1418, xW, yW, zW, xWR,yWR,zWR, false ) end, 5000, 1, xW,yW,zW,xWR,yWR,zWR)
-
I don't understand, you mean that timers doesn't work when using "onClientRender" as event handler?
-
What exactly doesn't work? do you get any error? mind posting the other script part?
-
Because it's fileCreate: https://wiki.multitheftauto.com/wiki/FileCreate
