-
Posts
15 -
Joined
-
Last visited
About AndresTVz
- Birthday 06/11/1997
Details
-
Gang
FoXX
-
Location
Chile
-
Occupation
Developer
-
Interests
n
Recent Profile Visitors
830 profile views
AndresTVz's Achievements

Square (6/54)
0
Reputation
-
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)
-
(AYUDA) Como Instalar LOGIN PANEL a GM DOWNTOWN
AndresTVz replied to DisparoHead's topic in Scripting
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. -
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
-
--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)
-
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
-
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 )
-
local screenW , screenH = guiGetScreenSize()
-
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
-
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
-
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.
-
AndresTVz changed their profile photo
-
Can you help me ? http://prntscr.com/8uz6tv