Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. "localPlayer" = El cliente. El cliente no es un vehiculo, verdad? es un jugador, por eso necesitas getPedOccupiedVehicle.
  2. You can check this topic: viewtopic.php?f=91&t=38456&p=400211
  3. Talvez es porque intentas obtener el nombre del vehiculo usando al elemeto del jugador? local vehiculo = getPedOccupiedVehicle(localPlayer) if (vehiculo) then local avion = getVehicleName (vehiculo) guiSetText(GUIEditor_Label[2], "Tu avion: ".. avion .. " .") end
  4. addEvent("lslv",true) addEventHandler("lslv",root, function () local namepla = getPlayerName(source) outputChatBox ("#C2C2C2 Enviando informacion a la torre de control de LS", source, 255, 255, 255, true) setTimer (outputChatBox, 4000, 1, "#C2C2C2 Recibido piloto ".. namepla .." En unos momentos te daremos el permiso de despege", source, 255, 255, 255, true) end)
  5. addCommandHandler("fine", function (thePlayer, cmd, player, ...) if (exports.global:isPlayerAdmin(thePlayer)) then local reason = table.concat({...}, " ") if (player ~= "" and reason ~= "") then local player = getPlayerFromName(player) outputChatBox(getPlayerName(player) .." was fined for: ".. tostring(reason)) end end end)
  6. No offense, but I agree with Benxamix.
  7. La funcion addCommandHandler en client side no tiene el argumento del jugador, tenes que usar localPlayer. Ademas, no estabas usando bien la variable "coche".
  8. Castillo

    Gridlists.

    You can do: triggerServerEvent("setTeam",localPlayer,getPlayerFromName(playerName))
  9. Castillo

    Gridlists.

    You'll need to use getPlayerFromName to get the player element from the name.
  10. Castillo

    Gridlists.

    function createPlayerList () --Create the grid list element playerList = guiCreateGridList ( 0.80, 0.10, 0.15, 0.60, true ) button = guiCreateButton( 0.7, 0.1, 0.2, 0.1, "Do", true ) addEventHandler("onClientGUIClick",button,onButtonClick,false) --Create a players column in the list local column = guiGridListAddColumn( playerList, "Player", 0.85 ) if ( column ) then --If the column has been created, fill it with players for id, player in ipairs(getElementsByType("player")) do local row = guiGridListAddRow ( playerList ) guiGridListSetItemText ( playerList, row, column, getPlayerName ( player ), false, false ) end end end function onButtonClick() local row,col = guiGridListGetSelectedItem(playerList) if (row and col and row ~= -1 and col ~= -1) then local playerName = guiGridListGetItemText(playerList, row, 1) outputChatBox("Hi ".. playerName) end end
  11. Castillo

    need help

    addEventHandler("onPlayerVehicleEnter", root, function(vehicle, seat, jacked) if (getPlayerTeam(source) and getTeamName(getPlayerTeam(source)) == "Police") then if getElementData(source, "Cuffed") then return end local model = getElementModel(vehicle) if (model == 598 or model == 596 or model == 597 or model == 427 or model == 490 or model == 599) then if (getPlayerWantedLevel(source) < 6) then setPlayerWantedLevel(source, getPlayerWantedLevel(source) + 1) end end end end)
  12. If I'm right, currentSound is not defined yet? because you're then using playSound (to play that sound?), maybe I'm wrong.
  13. rutals1 = createMarker(1528.76953125, -2593.37109375, 13.546875, 'cylinder', 5, 255, 0, 0, 100) function rutalss() local coche = getPedOccupiedVehicle ( localPlayer ) if isElementWithinMarker(localPlayer, rutals1) then GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Memo = {} GUIEditor_Label = {} GUIEditor_Image = {} GUIEditor_Window[1] = guiCreateWindow(193,57,424,513,"Panel de rutas.",false) GUIEditor_Image[1] = guiCreateStaticImage(85,35,263,104,"images/avion.png",false,GUIEditor_Window[1]) GUIEditor_Memo[1] = guiCreateMemo(102,144,216,68,"\n Bienvenido al panel de rutas.! Selecciona la ruta que deseas.",false,GUIEditor_Window[1]) GUIEditor_Button[1] = guiCreateButton(249,227,154,37,"LS - LV",false,GUIEditor_Window[1]) GUIEditor_Button[2] = guiCreateButton(41,227,157,35,"LV - LS",false,GUIEditor_Window[1]) GUIEditor_Button[3] = guiCreateButton(44,278,153,36,"LS - SF",false,GUIEditor_Window[1]) GUIEditor_Button[4] = guiCreateButton(248,279,154,41,"SF - LS",false,GUIEditor_Window[1]) GUIEditor_Button[5] = guiCreateButton(41,330,155,37,"SF - LV",false,GUIEditor_Window[1]) GUIEditor_Button[6] = guiCreateButton(248,336,143,41,"LV - SF",false,GUIEditor_Window[1]) GUIEditor_Label[1] = guiCreateLabel(146,458,158,38,"Tu posicion:",false,GUIEditor_Window[1]) GUIEditor_Label[2] = guiCreateLabel(152,393,158,31,"Tu avion: ".. coche and getVehicleName(coche) or "Ninguno.",false,GUIEditor_Window[1]) GUIEditor_Button[7] = guiCreateButton(388,483,27,21,"X",false,GUIEditor_Window[1]) else outputChatBox("No estas en un lugar para reparar el coche/avion.!", 255, 0, 0) end end addCommandHandler("ruta", rutalss) Me imagino que esto es client side, verdad? porque GUI es solo client side.
  14. local r = tonumber(getElementData(localPlayer,"Acolor1")) local g = tonumber(getElementData(localPlayer,"Acolor2")) local b = tonumber(getElementData(localPlayer,"Acolor3")) local label = table.popLast( spareElems ) myFonte = guiCreateFont( "img/prof.ttf", 10) guiSetSize(label, width, height, false) guiSetFont(label,myFonte) guiSetText(label, text) guiLabelSetColor(label, r, g, b) -- Now with r,g,b guiSetPosition(label, x, y+6, false) guiSetVisible(label, true)
  15. setCameraMatrix(source, 73.6,1763,48, 1468.388671875, -918.42474365234, 0, 0, 0, 25000) It has 8 arguments: 3 for position 3 for look at.
  16. Castillo

    Nitrobar

    Events...? you mean functions? You only need dxDrawRectangle and if you want to draw the nitro left in a text then dxDrawText.
  17. Castillo

    Nitrobar

    It's easy if you have DX drawing knowledge.
  18. Castillo

    Nitrobar

    Is not that easy, because there's no such function "getNitroLeft" or something similar. There's a resource called "race_nos", it's a script which has a nitro meter.
  19. Create a radar area and set this element data to it: "zombieProof". So it would be like this: myRadarArea = createRadarArea(args...) setElementData(myRadarArea,"zombieProof",true)
  20. old_dimension = {} --make an array to store previous dimensions of players addEvent("onPlayerDimensionChange", true) function checkDimensions() local this_dimension = {} --current dimensions of players local players = getElementsByType("player") for _, player in ipairs(players) do --cycle through all players this_dimension[player] = getElementDimension(player) if this_dimension[player] ~= old_dimension[player] then --if dimension is different than it was triggerEvent("onPlayerDimensionChange", player, old_dimension[player], this_dimension[player]) end end old_dimension = this_dimension --store this_dimension for the next check end setTimer(checkDimensions, 1000, 0) You put getElementPosition instead of getElementDimension at line 7.
  21. Para "agregar" armas a los zombies vas a necesitar editar el recurso "zombies", si tenes experiencia no deberia ser dificil, pero si no, entonces te recomiendo que empiezes a estudiar.
  22. So, example: Someone comes with a script which just has a empty function and it was supposed to be a drug system, and he'll say: "The scripts exists, they just have to be modified.". If you want to pay someone to do it, he/she will put the price.
×
×
  • Create New...