Jump to content

AndresTVz

Members
  • Posts

    15
  • Joined

  • Last visited

Everything posted by AndresTVz

  1. server.lua addCommandHandler('rw', function(player, cmd, world) for i = 550, 19999 do removeWorldModel(i, 10000, 0, 0, 0) end setOcclusionsEnabled(false) setWaterLevel(-5000) end)
  2. de poder puedes, pero debes saber cómo trabaja el login original. este debe tener funciones quizás para loguear, y al loguear llama a otra función o evento que abre el selector de personajes, normalmente los login tienen el diseño listo y la programación básica para trabajar solo con el servidor o solo con el propio recurso.
  3. this function sets your health, the maximum is 100, it does not mean that if you put 150 your maximum health will be 150, if you exceed it sometimes it tends to bug, put numbers between 0 - 100
  4. --Client GUIEditor = { button = {}, window = {}, label = {} } addEventHandler("onClientResourceStart", resourceRoot, function() local screenW, screenH = guiGetScreenSize() GUIEditor.window[1] = guiCreateWindow((screenW - 568) / 2, (screenH - 461) / 2, 568, 461, "tesst", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetVisible(GUIEditor.window[1], true) GUIEditor.button[300] = guiCreateButton(490, 85, 38, 21, "Create", false, GUIEditor.window[1]) GUIEditor.button[322] = guiCreateButton(532, 85, 26, 21, "Delete", false, GUIEditor.window[1]) end ) addEventHandler ('onClientGUIClick' , root, function () if source == GUIEditor.button[300] then triggerServerEvent("dor",localPlayer, localPlayer) end end ) addEventHandler ('onClientGUIClick' , root, function () if source == GUIEditor.button[322] then triggerServerEvent("cdor",localPlayer, localPlayer) end end ) --Server addEvent('dor',true) addEventHandler('dor',root, function(thePlayer) local ob1 = createObject(1508, 228.3, 149.7, 1003.7) local ob2 = createObject(1508, 228.3, 227, 1203) end ) addEvent("cdor",true) addEventHandler("cdor",root, function(thePlayer) for k, object in ipairs(getElementsByType("object")) do destroyElement(object) iprint(object) end playSoundFrontEnd(thePlayer, 46) end)
  5. local sx_, sy_ = guiGetScreenSize() local sx, sy = sx_/1280, sy_/720 local screenW, screenH = guiGetScreenSize() --------------------------- -- Draw PING --------------------------- function drawPing() local ping = getPlayerPing(localPlayer) dxDrawText("PING: "..ping, 1180*sx, 620*sy, 0*sx, 0*sy, tocolor(255, 255, 255), 1*sx, 1*sy, "default-bold", "center", "top", false, false, false, true, false) end --------------------------- -- Draw FPS --------------------------- local FPSLimit, lastTick, framesRendered, FPS = 60, getTickCount(), 1, 1 function drawFps() local currentTick = getTickCount() local elapsedTime = currentTick - lastTick if elapsedTime >= 1000 then FPS = framesRendered lastTick = currentTick framesRendered = 1 else framesRendered = framesRendered + 1 end if FPS > FPSLimit then FPS = FPSLimit end dxDrawText("FPS: "..FPS, 1280*sx, 620*sy, 0*sx, 0*sy, tocolor(255, 255, 255), 1*sx, 1*sy, "default-bold", "center", "top", false, false, false, true, false) end addEventHandler("onClientResourceStart", root, function() addEventHandler("onClientRender", root, drawPing) addEventHandler("onClientRender", root, drawFps) end) Try now
  6. addcommandHandler can also be used on the client just put the command directly on the client and avoid using the triggerClientEvent Server: --[[addEvent("onPlayerVehicleEnter", true) addEventHandler("onPlayerVehicleEnter", getRootElement(),]]-- function createArmedBobcat(source) local lx,ly,lz = getElementPosition(source) -- get the position of the player local lx = lx + 5 -- add 5 units to the x position veh = createVehicle( 422, lx, ly, lz) -- create a bobcat base = createObject( 2985, 2,2,2) -- create a minigun_base object setElementCollisionsEnabled ( base, false ) -- the minigun_base damages the car -- you could alternatively load an empty col file for the minigun object attachElements ( base, veh, x,y,z,rx,ry,rz) -- attach the base to the bobcat end addCommandHandler("bobcat", createArmedBobcat) Client function enterGun_Handler(localPlayer) end addEventHandler("onClientColShapeHit", root, enterGun_Handler) local x,y,z,rx,ry,rz= 0,-1.5,-0.1,0,0,-90 function rotateIt(command, addZ) if(addZ) then rz=rz+addZ setElementAttachedOffsets (base,x,y,z,rx,ry,rz) --update offsets end end addCommandHandler("rotate", rotateGun) in Server you receives playerSource, command, --> args and client only command and --> args try It may still work for you but the function asks for two variables that you defined as cmd and addZ but when you run it from the server it is not sending any data, eg: -- CLIENT function greetingHandler ( message ) outputChatBox ( "The server says: " .. message ) end addEvent( "onGreeting", true ) addEventHandler( "onGreeting", localPlayer, greetingHandler ) -- SERVER function greetingCommandOne ( playerSource, commandName, playerName ) if playerName then local thePlayer = getPlayerFromName ( playerName ) if thePlayer then triggerClientEvent ( thePlayer, "onGreeting", thePlayer, "Hello World!" ) else end else end end addCommandHandler ( "greet_one", greetingCommandOne )
  7. local screenW , screenH = guiGetScreenSize()
  8. If it is a vps it must come with its default port unless you asked for it with 22003, so you should be able to enter with the ip plus the port that comes with the vps
  9. Lo que podrias hacer es: addEventHandler("onClientResourceStart",root, function() local infernusTXD = engineLoadTXD("infernus.txd") local infernusDFF = engineLoadDFF("infernus.dff",411) engineImportTXD(infernusTXD,411) engineReplaceModel(infernusDFF,411) end) esto remplazara el auto que quieres por un auto que "ya es parte del juego". Que en este caso sera el infernus el cual tiene la ID = 411 Las ID aqui estan: https://wiki.multitheftauto.com/wiki/Vehicle_IDs
  10. addEventHandler( "onPlayerWasted", root, function() spawnPlayer (source, x, y , z ) end )
  11. isCursorHover = function(x,y,width,height) local sx,sy = guiGetScreenSize() if isCursorShowing() then local cX,cY,_,_,_ = getCursorPosition() if cX and cY then if cX >= x/sx and cX <= (x+width)/sx and cY >= y/sy and cY <= (y+height)/sy then return true end end end return false end If the mouse is within the values that you enter the function, it will return true.
  12. la verdad que poco se puede deducir de tu codigo, lo que yo te recomiendo es que lo separes y imprimas cada informacion, verificando si el valor que da es el correcto, ejemplo: outputDebugString( aclGetGroup( group.aclGroup ) ) -- esto deberia darte el nombre del grupo que deveria estar en la acl
  13. Hey guys, I will present a new script by me :3 ( first )I hope you like.
×
×
  • Create New...