Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. Castillo

    Need Help

    .... p_column = guiGridListAddColumn( CopComputer_Grid[1], "player", 0.70 ) w_column = guiGridListAddColumn( CopComputer_Grid[1], "Wanteds", 0.20) guiGridListSetSelectionMode(CopComputer_Grid[1],1) CopComputer_Button[3] = guiCreateButton(43,365,108,35,"locate",false,CopComputer_Window[1]) ..... function btn3() local rowindex, columnindex = guiGridListGetSelectedItem ( CopComputer_Grid[1] ) local playername = guiGridListGetItemText ( CopComputer_Grid[1], rowindex, 1) triggerServerEvent("orten", getRootElement(), getLocalPlayer(), playername) setTimer(refreshcopcomp,1000,1) end
  2. Castillo

    Need Help

    function MarkPlayer(thePlayer,playername) local player = getPlayerFromName(playername) if (player) then local x,y,z = getElementPosition ( player ) local blip = createBlip (x, y, z, 41, 4, 255, 0, 0,255, 0, 99999.0, thePlayer) setTimer(destroyElement,20000,1,blip) else outputChatBox("Player not found",thePlayer,255,0,0) end end addEvent("orten", true) addEventHandler("orten", getRootElement(), MarkPlayer)
  3. 1: checking = 0 function FPSStart () local x,y,z = getElementPosition( getLocalPlayer() ) Body = createObject (983, x, y, z ) attachElements ( Body, getLocalPlayer(), 0, -0.1, 0.45, 90, 0, 90) setElementAlpha( Body, 0) setTimer ( setElementAlpha,1000, 1, getLocalPlayer(), 0) end addCommandHandler("fps",FPSStart) function invisOnSpawn() setElementAlpha(getLocalPlayer(), 0) end addEventHandler ( "onClientPlayerSpawn", getLocalPlayer(), invisOnSpawn ) function climbcheck() setElementCollisionsEnabled(Body, false) if checking == 0 then checking = 1 stopclimbcheck = setTimer ( stopCcheck, 1200, 1 ) addEventHandler ("onClientRender", getRootElement(), areyouclimbing) elseif checking == 1 then killTimer(stopclimbcheck) stopclimbcheck = setTimer ( stopCcheck, 1200, 1 ) end end bindKey ("jump", "down", climbcheck ) function stopCcheck() setElementCollisionsEnabled(Body, true) removeEventHandler("onClientRender", getRootElement(), areyouclimbing) setCameraTarget (getLocalPlayer()) checking = 0 end function areyouclimbing() hx,hy,hz = getPedBonePosition ( getLocalPlayer(), 8 ) local rot = getPedRotation (getLocalPlayer()) radRot = math.rad ( rot ) local radius = .5 local tx = hx + radius * math.sin(radRot) local ty = hy + -(radius) * math.cos(radRot) local tz = hz setCameraMatrix(tx,ty,tz,hx,hy,hz) if ( isPedDoingTask ( getLocalPlayer(), "TASK_SIMPLE_CLIMB" ) ) then killTimer(stopclimbcheck) doneclimbyet = setTimer ( finishCcheck, 400, 1 ) end end function finishCcheck() if ( isPedDoingTask ( getLocalPlayer(), "TASK_SIMPLE_CLIMB" ) ) then doneclimbyet = setTimer ( finishCcheck, 400, 1 ) else finishedclimbing() end end function finishedclimbing() checking = 0 removeEventHandler("onClientRender", getRootElement(), areyouclimbing) setElementCollisionsEnabled(Body, true) setCameraTarget (getLocalPlayer()) end function FPSStop (startedresource) if startedresource == getThisResource() then setElementAlpha( getLocalPlayer(), 255) setCameraTarget (getLocalPlayer()) end end addEventHandler ( "onClientResourceStop", getRootElement(), FPSStop) function shakeCamera(weapon) x,y,z = getPedBonePosition ( getLocalPlayer(), 26 ) if weapon == 24 then createExplosion ( x,y,z + 10,12,false,0.4,false) elseif weapon == 25 then createExplosion ( x,y,z + 10,12,false,0.5,false) elseif weapon == 26 then createExplosion ( x,y,z + 10,12,false,0.7,false) elseif weapon == 27 then createExplosion ( x,y,z + 10,12,false,0.5,false) elseif weapon == 29 then createExplosion ( x,y,z + 10,12,false,0.2,false) elseif weapon == 30 then createExplosion ( x,y,z+10,12,false,0.2,false) elseif weapon == 31 then createExplosion ( x,y,z + 10,12,false,0.3,false) elseif weapon == 33 then createExplosion ( x,y,z + 10,12,false,0.3,false) elseif weapon == 34 then createExplosion ( x,y,z + 10,12,false,0.3,false) elseif weapon == 22 then createExplosion ( x,y,z + 10,12,false,0.1,false) elseif weapon == 28 then createExplosion ( x,y,z + 10,12,false,0.2,false) elseif weapon == 32 then createExplosion ( x,y,z + 10,12,false,0.2,false) elseif weapon == 38 then createExplosion ( x,y,z + 10,12,false,0.6,false) end end addEventHandler ( "onClientPlayerWeaponFire", getLocalPlayer(), shakeCamera ) function carcheck(player) if player == getLocalPlayer() then abortCarEnterCheck = setTimer ( checkCarTask, 100, 1 ) setElementCollisionsEnabled(Body, false) setElementAlpha(getLocalPlayer(), 255) end end addEventHandler ( "onClientVehicleStartEnter", getRootElement(), carcheck ) function checkCarTask() local stask = getPedSimplestTask(getLocalPlayer()) if (stask == "TASK_SIMPLE_CAR_GET_IN") or (stask == "TASK_SIMPLE_GO_TO_POINT") or (stask == "TASK_SIMPLE_CAR_OPEN_DOOR_FROM_OUTSIDE") or (stask == "TASK_SIMPLE_CAR_ALIGN") or (stask == "TASK_SIMPLE_CAR_CLOSE_DOOR_FROM_INSIDE") or (stask == "TASK_SIMPLE_CAR_SHUFFLE") or (stask == "TASK_SIMPLE_CAR_DRIVE") or (stask == "TASK_SIMPLE_ACHIEVE_HEADING") then abortCarEnterCheck = setTimer ( checkCarTask, 100, 1 ) elseif (isPedInVehicle(getLocalPlayer()) == false) then --enter vehicle was aborted setElementCollisionsEnabled(Body, true) setElementAlpha(getLocalPlayer(), 0) end end function carexit(player) if player == getLocalPlayer() then setElementCollisionsEnabled(Body, true) setElementAlpha(getLocalPlayer(), 0) end end addEventHandler ( "onClientVehicleExit", getRootElement(), carexit ) end) 2: Te falto agregarle un evento para la funcion. addEventHandler("onClientResourceStart",resourceRoot, function() local skinTXD = engineLoadTXD ( "Models/469.txd" ) --Sparrow/Ovni "aliens engineImportTXD ( skinTXD , 469 ) local skinDFF = engineLoadDFF("Models/469.dff", 469 ) engineReplaceModel(skinDFF , 469) local skinTXD = engineLoadTXD ( "Models/522.txd" ) --Nrg-500/Aerosphere "aliens" engineImportTXD ( skinTXD , 522 ) local skinDFF = engineLoadDFF("Models/469.dff", 522 ) engineReplaceModel(skinDFF , 522) end )
  4. Para que tanto lio, la pisas y listo . P.D: Me tomaria el ron yo.
  5. https://community.multitheftauto.com/index.php?p= ... ls&id=3816 Everything on it is made by other people, nothing from him I guess.
  6. Castillo

    help

    Open "race/race_client.lua" and search for: guiSetText(g_GUI.speclabel, 'Currently spectating:\n' .. getPlayerName(Spectate.target)) and replace it with this: guiSetText(g_GUI.speclabel, 'Currently spectating:\n' .. removeColorCoding(getPlayerName(Spectate.target)))
  7. This is a spawn system: https://community.multitheftauto.com/index.php?p= ... ls&id=1152
  8. Castillo

    help

    Race has a function called: removeColorCoding Just use it.
  9. You mean passengers can't enter because they are not using the X skin? If so, you must check if the seat is 0. fbi1 = createVehicle ( 596, -2429.7998046875, 515.2998046875, 29.700000762939, 0, 0, 215.99670410156 ) fbi2 = createVehicle ( 596, -2425.69921875, 518.5, 29.700000762939, 0, 0, 221.99523925781 ) fbi3 = createVehicle ( 596, -2422.3994140625, 521.599609375, 29.700000762939, 0, 0, 225 ) function lockfbi(player, seat, jacked) if (source == fbi1 or source == fbi2 or source == fbi3) then if (seat == 0) then local skin = getElementModel (player) if not (skin == 100 or skin == 255) then --FBI skins cancelEvent() outputChatBox ( "Only FBI can enter this vehicle", player, 0, 0, 150, true ) end end end end addEventHandler ( "onVehicleStartEnter", getRootElement(), lockfbi )
  10. 1. I don't understand what do you mean by "multiple spawns". 2. You can create radar areas (turfs if you like) and choose the color of it (R, G, B, A) https://wiki.multitheftauto.com/wiki/CreateRadarArea
  11. Castillo

    help

    I don't see anything, what is the problem, can't you just explain it with words?
  12. Castillo

    Admin Levels

    This is the only one I've found: https://community.multitheftauto.com/index.php?p= ... ls&id=3196
  13. Para hacer eso tenes que aprender a programar en Lua.
  14. function Teleport() marker_areabase_gate_in = createMarker(2492.8999023438,2773.3000488281,9.6000003814697,"cylinder",7, 91, 0, 0, 26 ) addEventHandler ("onMarkerHit",marker_areabase_gate_in,teleport_areabase_gate1) marker_areabase_gate_out = createMarker(2502.1999511719,2773.3000488281,9.6000003814697,"cylinder",7, 91, 0, 0, 26 ) addEventHandler ("onMarkerHit",marker_areabase_gate_out,teleport_areabase_gate2) end addEventHandler ("onResourceStart",resourceRoot,Teleport) function teleport_areabase_gate1(hitElement) if (getElementType(hitElement) == "vehicle") then hitPlayer = hitElement skin = getElementModel (getVehicleController(hitPlayer)) elseif (getElementType(hitElement) == "player") then hitPlayer = hitElement local skin = getElementModel (hitPlayer) end if ( skin == 130 or skin == 160) then setElementPosition (hitPlayer, 2509.3999023438, 2773.5, 11,false) end end function teleport_areabase_gate2(hitElement) if (getElementType(hitElement) == "vehicle") then hitPlayer = hitElement skin = getElementModel (getVehicleController(hitPlayer)) elseif (getElementType(hitElement) == "player") then hitPlayer = hitElement skin = getElementModel (hitPlayer) end if ( skin == 130 or skin == 160) then setElementPosition ( hitPlayer, 2485.6999511719, 2773.5, 11,false) end end
  15. Si no tenes experience en programacion Lua, entonces te sugiero que empiezes a aprender. https://wiki.multitheftauto.com/wiki/Scr ... troduction https://wiki.multitheftauto.com/wiki/Int ... ng_the_GUI -- para menus y eso.
  16. function onTut() local screenWidth, screenHeight = guiGetScreenSize() local mainWidth,mainHeight = 200,0 dxDrawRectangle (screenWidth/3-mainWidth/2,screenHeight/3,screenWidth/2.5,screenHeight/6,tocolor(0,0,0,150)) dxDrawText(tabla[numero],screenWidth/2-mainWidth/2,screenHeight/2-mainHeight/2,screenWidth/1.4,screenHeight/3,tocolor(255,255,255,255),2,"bankghotic","center","center") end numero = 1 local desabilitado = false function enTut() if (not desabilitado) then addEventHandler("onClientRender",source,onTut) desabilitado = true setTimer ( function() desabilitado = false numero = numero + 1 end, 5000,1) end end bindKey("enter","up",enTut) addEventHandler("onClientResourceStart",resourceRoot,enTut) Deberia mostrarlo para todos los clientes cuando el recurso inicie, osea que cuando luego entre otro jugador, se lo mostrara para el solo.
  17. El evento: "onClientPlayerJoin" no funciona para el jugador que se conecto (el cliente). P.D: Queres que la funcion "onTut" se ejecute solo para el jugador que entro al servidor? solo podes usar getRootElement() (root) en onClientRender.
  18. local desabilitado = false function hola() if (not desabilitado) then outputChatBox("Hola") desabilitado = true setTimer ( function() desabilitado = false end, 5000,1) end end bindKey ("enter", "down", hola)
  19. Castillo

    Ayuda

    El recurso inicio? estas seguro de que no hay ningun error en el script?
  20. unbindKey ("tecla", "down", funcion) setTimer ( function() bindKey ("tecla", "down", funcion) end, 300000,1)
  21. Castillo

    Ayuda

    No es eso, deberia funcionar en el client side.
  22. onClientRender is a event handler. https://wiki.multitheftauto.com/wiki/OnClientRender
  23. Castillo

    GUI Table

    local gui_Table = { ['profile_label'] = guiCreateLabel((20/800)*sx,(312/600)*sy,(158/800)*sx,(29/600)*sy,'Profile',true,gui['panel']), ['stats_label'] = guiCreateLabel((20/800)*sx,(358/600)*sy,(158/800)*sx,(29/600)*sy,'Stats',true,gui['panel']), ['shop_label'] = guiCreateLabel((21/800)*sx,(405/600)*sy,(158/800)*sx,(29/600)*sy,'Shop',true,gui['panel']), ['top_label'] = guiCreateLabel((21/800)*sx,(452/600)*sy,(158/800)*sx,(29/600)*sy,'Top',true,gui['panel']), ['sms_label'] = guiCreateLabel((44/800)*sx,(495/600)*sy,(110/800)*sx,(22/600)*sy,'SMS',true,gui['panel']), ['time_label'] = guiCreateLabel((14/800)*sx,(241/600)*sy,(169/800)*sx,(34/600)*sy,'23:00',true,gui['panel']), ['time'] = guiCreateStaticImage((13/800)*sx,(210/600)*sy,(172/800)*sx,(77/600)*sy,'_utils/_data/_image/memo_hover.png',true,gui['panel']), ['panel'] = guiCreateStaticImage((0/800)*sx,(194/600)*sy,(197/800)*sx,(378/600)*sy,'_utils/_data/_image/main.png',true,false), ['button1'] = guiCreateStaticImage((19/800)*sx,(298/600)*sy,(160/800)*sx,(41/600)*sy,'_utils/_data/_image/button1.png',true,gui['panel']), ['button2'] = guiCreateStaticImage((19/800)*sx,(344/600)*sy,(160/800)*sx,(41/600)*sy,'_utils/_data/_image/button1.png',true,gui['panel']), ['button3'] = guiCreateStaticImage((20/800)*sx,(389/600)*sy,(160/800)*sx,(42/600)*sy,'_utils/_data/_image/button1.png',true,gui['panel']), ['button4'] = guiCreateStaticImage((20/800)*sx,(436/600)*sy,(160/800)*sx,(42/600)*sy,'_utils/_data/_image/button1.png',true,gui['panel']), ['button5'] = guiCreateStaticImage((45/800)*sx,(488/600)*sy,(111/800)*sx,(30/600)*sy,'_utils/_data/_image/button1.png',true,gui['panel']), ['more'] = guiCreateStaticImage((76/800)*sx,(527/600)*sy,(44/800)*sx,(37/600)*sy,'_utils/_data/_image/options.png',true,gui['panel']) } guiSetVisible(gui_Table["profile_label"], false)
  24. http://lua-users.org/wiki/TablesTutorial ipairs works with indexed tables as far as I know, and pairs works with every kind of table (I may be wrong too).
  25. Ah, I understand now, you're using 'ipairs' instead of 'pairs', you can't use 'ipairs' in that kind of table. local marker = createMarker (1605.600, -1625.300, 12.5, "cylinder", 2, 25, 50, 255, 255 ) local cars = { [596] = 'Police LS', [597] = 'Police SF', [598] = 'Police LV', [599] = 'Police Ranger' } window = guiCreateWindow(561,187,260,388,"Spawn Vehicle",false) guiWindowSetSizable(window,false) spawnButton = guiCreateButton(26,317,96,37,"Spawn",false,window) closeButton = guiCreateButton(142,318,96,37,"Close",false,window) carGrid = guiCreateGridList(23,34,210,249,false,window) guiGridListSetSelectionMode(carGrid,0) column = guiGridListAddColumn(carGrid,"Vehicle name",0.85) for id,vehName in pairs(cars) do local row = guiGridListAddRow ( carGrid ) guiGridListSetItemText ( carGrid, row, column, tostring(vehName), false, false ) guiGridListSetItemData ( carGrid, row, column, tonumber(id), false, false ) end function showWindow() local playerTeam = getPlayerTeam (localPlayer) local teamName = getTeamName ( playerTeam ) if (teamName == "Police") then guiSetVisible( window, true ) showCursor(true) end end addEventHandler ("onClientMarkerHit", marker, showWindow) function spawn() local row,col = guiGridListGetSelectedItem(carGrid) if (row and col and row ~= -1 and col ~= -1) then local model = guiGridListGetItemData(carGrid, row, 1) triggerServerEvent('onGUIClick',localPlayer,tonumber(model)) end end addEventHandler('onClientGUIClick',spawnButton, spawn, false) function setVisible() guiSetVisible(window,false) showCursor(false) end addEvent('setGUIVisible',true) addEventHandler('setGUIVisible',root,setVisible) function closeWindow() guiSetVisible(window,false) showCursor(false) end addEventHandler ("onClientGUIClick", closeButton, closeWindow, false)
×
×
  • Create New...