-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
Zakna, lo que yo le dije es mas bien lo que vos decis, pero distinto.
-
[Pregunta-noob]Como aprendieron a scriptear con LUA?
Castillo replied to Javier_Marquez's topic in Scripting
Zakna, mas bien, lo que el usuario esta preguntando es como aprender a programar/scriptear. -
What the... is that? Edit: Oh, i see, a library to make things easier for newbies
-
I would remove this resource, https://community.multitheftauto.com/index.php?p= ... ls&id=1955 nothing at it is from him, and also contains at least 3 car mods.
-
I think you don't know how MTA scripting system works, right? there's no such function, teleport2:setExitAngle(0) teleport2:keepVelocityOnExit() teleport2:addHandler(hitTeleport) teleport3:setExitAngle(0) teleport3:keepVelocityOnExit() teleport3:addHandler(hitTeleport2) I don't know where you got this from, but it's epicly incorrent o,o. try learning some stuff from the wiki. https://wiki.multitheftauto.com/wiki/Main_Page
-
You should use xmlUnloadFile after saving it! if i'm right it can cause problems.
-
Why do you need such thing? you could easily use element data and then loop with every pickup. --client side addEventHandler("onClientClick", getRootElement(), function (button, state, ax, ay, wx, wy, wz) if state=="up" and button=="left"then triggerServerEvent("onPickupBiznesCreate",getLocalPlayer(), wx, wy, wz) end end) function endBiznesCreation() for i,v in pairs(getElementsByType("pickup")) do if getElementData(v,"text") then local px, py, pz = getElementPosition (getLocalPlayer()) local wx, wy, wz = getElementPosition(v) dist = getDistanceBetweenPoints3D ( px, py, pz, wx, wy, wz ) if dist < 20.0 then local x, y = getScreenFromWorldPosition ( wx, wy, wz ) if x then dxDrawText("Biznes",x,y+2,x+2,y,tocolor(0,0,0),1,"default-bold","center","center") dxDrawText("Biznes",x,y,x,y,tocolor(49,140,231),1,"default-bold","center","center") end end end end end addEventHandler("onClientRender",getRootElement(),endBiznesCreation) --server side function pickupBiznes(wx, wy, wz) pickup = createPickup(wx,wy,wz,3,1273) setElementData(pickup,"text",true) end addEvent("onPickupBiznesCreate", true) addEventHandler("onPickupBiznesCreate", getRootElement(), pickupBiznes) Should work (not tested)
-
Well, firstly, you need to create your ACL groups, Admin1, Admin2, etc, and then you can easily script this. Level10list = "" Level9list = "" Level8list = "" Level7list = "" function createAdminList() Level10list = "" Level9list = "" Level8list = "" Level7list = "" for k, v in ipairs(getElementsByType("player")) do if not isGuestAccount(getPlayerAccount(v)) then if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(v)), aclGetGroup("Admin")) then Level10list = Level10list .. " " .. getPlayerName(v) elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(v)), aclGetGroup("Admin9")) then Level9list = Level9list .. " " .. getPlayerName(v) elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(v)), aclGetGroup("Admin8")) then Level8list = Level8list .. " " .. getPlayerName(v) elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(v)), aclGetGroup("Admin7")) then Level7list = Level7list .. " " .. getPlayerName(v) end end end end function adminList(sourcePlayer) createAdminList() if (Level10list == "") then outputChatBox("There is no level 10 Admins !", sourcePlayer, 255, 0, 0 ) else outputChatBox("Admins Level 10 : " .. tostring(Level10list), getRootElement (), 255, 255, 0, true) end if (Level9list == "") then outputChatBox("There is no level 9 Admins !", sourcePlayer, 255, 0, 0 ) else outputChatBox("Admins Level 9 : " .. tostring(Level9list), getRootElement (), 255, 255, 0, true) end if (Level8list == "") then outputChatBox("There is no level 8 Admins !", sourcePlayer, 255, 0, 0 ) else outputChatBox("Admins Level 8 : " .. tostring(Level8list), getRootElement (), 255, 255, 0, true) end if (Level7list == "") then outputChatBox("There is no level 7 Admins !", sourcePlayer, 255, 0, 0 ) else outputChatBox("Admins Level 7 : " .. tostring(Level7list), getRootElement (), 255, 255, 0, true) end end function checkCommand ( message, messageType ) if ( messageType == 0 ) then if ( message == "!admins" ) then setTimer( adminList, 100, 1, source ) end end end addEventHandler ( "onPlayerChat", getRootElement(), checkCommand ) Should work, it is server side.
-
Aren't the DFF file(s) model(s)?
-
Well, those aren't too much changes (there could be more, like: mini games, colours added, and so on)
-
I'am Chaos District scripter, and we're working hard on it, trying to make a perfect server.
-
lol, sorry, i forgot to edit something, copy again the code.
-
It's a forum bug.
-
Usually when we say "SQL" we're referring to "SQLite"
-
You are right Citizen, i forgot about that
-
Well, bindKey in server side is different than client side. ambulances = { [416]=true } perso = { ["urgences"]=true } addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function () for i,v in pairs(getElementsByType("player")) do bindKey(v,"num_1","down",sirenAmu1) end end) -- sirenes ambu function sirenAmbu1 ( player ) local commandant = getPedOccupiedVehicle(player) if ( ambulances[getElementModel(commandant)] ) and ( perso[getTeamName(getPlayerTeam( player ))] ) then triggerClientEvent ( "sirenAmbu1", getRootElement(), commandant ) end end Try it (not tested)
-
Try this, function buildWindow() mainWindow = guiCreateWindow(getX(25), getY(25), getX(50), getY(50), "Double-click a destination!", false) guiWindowSetSizable(mainWindow,false) guiWindowSetMovable(mainWindow,false) guiSetVisible(mainWindow, false) taxiGridList = guiCreateGridList(getX(1), getY(2), getX(48), getY(47), false, mainWindow) guiGridListSetSortingEnabled ( taxiGridList, false ) guiGridListAddColumn(taxiGridList,"ID",0.05) guiGridListAddColumn(taxiGridList,"Description",0.-- s8) --> guiGridListAddColumn(taxiGridList,"Rate",0.13) addEventHandler( "onClientGUIDoubleClick", taxiGridList, submitTaxi, false) end addEventHandler("onClientResourceStart", getResourceRootElement( getThisResource() ), buildWindow) function toggleTaxiWindow() if (guiGetVisible(mainWindow) == true) then guiSetVisible(mainWindow, false) showCursor(false) guiGridListClear(taxiGridList) else guiSetVisible(mainWindow, true) showCursor(true) triggerServerEvent("requestDestinations",getLocalPlayer()) end end bindKey("F2","down",toggleTaxiWindow) --Accepts the info from the server, adds to the gridlist. Event isnt triggered by this function. function populateGridList(id, name) local row = guiGridListAddRow(taxiGridList) guiGridListSetItemText ( taxiGridList, row, 1, tostring(id), false, false ) guiGridListSetItemText ( taxiGridList, row, 2, tostring(name), false, false ) guiGridListSetItemText ( taxiGridList, row, 3, "$1 / 20 KM", false, false ) end addEvent("receiveDestinations", true) addEventHandler("receiveDestinations", getRootElement(), populateGridList) function submitTaxi( button, state, sx, sy, x, y, z, elem, gui ) if ( source == taxiGridList and state == "down") then destId= guiGridListGetItemText (taxiGridList, guiGridListGetSelectedItem (taxiGridList), 1) outputChatBox(tostring(destId)) end end
-
Ayuda con el server no se que hice O.O
Castillo replied to juniorblinxs's topic in Ayuda relacionada al cliente/servidor
Quitale la IP del mtaserver.conf no es necesaria y puede causar errores, ademas checkea si tienes los puertos abiertos. -
[Pregunta-noob]Como aprendieron a scriptear con LUA?
Castillo replied to Javier_Marquez's topic in Scripting
Hola y bienvenido al foro! Yo aprendi en la wikipedia (aprendi ingles en el mta primero ), aca te dejo un link a la wiki en español (no esta todo traducido claro, pero algo es ) https://wiki.multitheftauto.com/index.ph ... _Principal -
It depends on which scoreboard do you use, there are two so far, normal scoreboard and dxscoreboard (this one allows colours by default) You can get it here: https://community.multitheftauto.com/index.php?p= ... ils&id=419
