Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. I think these are variants, use: setVehicleVariant
  2. Castillo

    Ayuda - Timer

    function DownA ( hitPlayer ) if ( hitPlayer ) then setTimer ( moveObject, 5000, 1, sense, 6000, posX, posY, posZ ) end end addEventHandler ( "onMarkerHit", sensem, DownA )
  3. Eso es SQLite, MySQL se conecta a servidores MySQL.
  4. Castillo

    Tablas.

    Lo que podes hacer es crear una tabla donde guardas el index de cada jugador, y luego usas ese index en lugar de math.random.
  5. You should use moveObject, not setObjectRotation.
  6. dbConnect dbExec dbQuery dbPoll dbFree Cada funcion tiene un ejemplo que yo sepa. Tambien esta el de Ryden, pero yo uso este porque es mas facil en mi opinion, ademas, que yo sepa es mejor.
  7. You named your variable of the object same as the function name. local gate = createObject ( 971, 1589, -1638.0999755859, 14.800000190735, 0, 0, 180 ) state = 0 function moveGate() if state == 0 then moveObject( gate, 1589, -1638.0999755859, 7.3000001907349) state = 1 else moveObject ( gate, 1589, -1638.0999755859, 14.800000190735) state = 0 end end addCommandHandler( "gate", moveGate)
  8. Castillo

    Need help !!

    My code will hide the window after being created.
  9. Castillo

    Need help !!

    Copy my code again.
  10. Castillo

    Need help !!

    You forgot to define the tables. function startup ( ) GUIEditor_TabPanel = { } GUIEditor_Tab = { } GUIEditor_Memo = { } infoGui = guiCreateWindow(0.2463,0.0567,0.5913,0.68,"Information by Mark",false) guiSetAlpha(infoGui,1) guiWindowSetSizable(infoGui,false) guiWindowSetMovable(infoGui,true) guiSetVisible(infoGui,false) GUIEditor_TabPanel[1] = guiCreateTabPanel(9,39,455,351,false,infoGui) GUIEditor_Tab[1] = guiCreateTab("Rules",infoGui) GUIEditor_Memo[1] = guiCreateMemo(6,8,442,313,"\n Rules",false,GUIEditor_Tab[1]) GUIEditor_Tab[2] = guiCreateTab("Information",infoGui) GUIEditor_Memo[2] = guiCreateMemo(6,8,442,313,"\n Information",false,GUIEditor_Tab[2]) end addEventHandler ( "onClientResourceStart", resourceRoot, startup ) function Guishow() if (guiGetVisible(infoGui)) then showCursor(false) guiSetVisible(infoGui,false) else showCursor(true) guiSetVisible(infoGui,true) end end bindKey ("F1", "down", Guishow ) GUIEditor_TabPanel = { } GUIEditor_Tab = { } GUIEditor_Memo = { } These.
  11. As far as I know, none is legal.
  12. local rootElement = getRootElement() local busses = {[431] = true, [437] = true} local busTable = { [1]={1812.65198, -1889.86047, 13.41406}, [2]={1825.22791, -1635.03711, 13.38281}, [3]={1855.01685, -1430.47449, 13.39063}, [4]={1732.81580, -1296.87122, 13.44294}, [5]={1473.19226, -1295.77124, 13.48315}, [6]={1443.60376, -1498.26660, 13.37650}, [7]={1426.37280, -1716.12439, 13.38281}, [8]={1315.06909, -1656.43799, 13.38281}, [9]={1359.06250, -1432.39734, 13.38281}, [10]={1169.82983, -1392.34473, 13.41728}, [11]={930.76508, -1392.92627, 13.26561}, [12]={815.24756, -1317.91345, 13.44460}, [13]={585.04199, -1320.53748, 13.40609}, [14]={526.99365, -1624.20361, 16.63225}, } function joinMedic() setPlayerTeam(source, getTeamFromName("Civilians")) setElementModel(source,15) setElementData(source, "Occupation", "Bus Driver", true) outputChatBox("You are now Bus Driver.",source,0,255,0) end addEvent("setMedic", true) addEventHandler("setMedic",root,joinMedic) function getNewBusLocation(thePlayer, ID) local x, y, z = busTable[ID][1], busTable[ID][2], busTable[ID][3] triggerClientEvent(thePlayer,"bus_set_location",thePlayer,x,y,z) end function onVehicleEnter(thePlayer) if not busses[getElementModel(source)] then return end if getElementData ( thePlayer, "Occupation" ) then local x, y, z = getNewBusLocation(thePlayer, 1) setElementData(thePlayer,"busData",1) end end addEventHandler("onVehicleEnter",rootElement,onVehicleEnter) addEvent("bus_finish",true) addEventHandler("bus_finish",rootElement, function (client) if not isPedInVehicle(client) then return end if not busses[getElementModel(getPedOccupiedVehicle(client))] then return end givePlayerMoney(client, 100) if #busTable == tonumber(getElementData(client,"busData")) then setElementData(client,"busData",1) else setElementData(client,"busData",tonumber(getElementData(client,"busData"))+1) end getNewBusLocation(client, tonumber(getElementData(client,"busData"))) end)
  13. Notice to all: do not attempt to distribute or sell leaked valhalla content or content built upon leaked valhalla content, unless we hear express permission from the valhalla team.
  14. You can make it client side. createMarker with onClientMarkerHit and guiSetVisible
  15. "Police" variable is defined, right? Also, are you sure the health lost is higher than 2?
  16. function HeliTable ( thePlayer ) local theVehicle = getPedOccupiedVehicle ( thePlayer ) if ( theVehicle ) then local id = getElementModel ( theVehicle ) if ( id == 487 or id == 497 ) then table1 = createObject ( 1698, 0, 0, 0 ) table2 = createObject ( 1698, 0, 0, 0 ) ----------------------------------------------------- attachElements ( table1, theVehicle, 1.5, 1, -1 ) attachElements ( table2, theVehicle, -1.5, 1, -1 ) ----------------------------------------------------- outputChatBox ( "#00FF00Paneles Creados.", getRootElement(), 255, 255, 255, true ) else outputChatBox ( "#FF0000No funco!.", getRootElement(), 255, 255, 255, true ) end end end addCommandHandler ( "paneles", HeliTable )
  17. function convertTime ( ms ) if ( ms and type ( ms ) == "number" ) then local mins = math.floor ( ms / 60000 ) local hours = math.floor ( mins / 60 ) local secs = math.floor ( ( ms / 1000 ) % 60 ) return string.format ( "%s:%s:%s", hours, ( mins - hours * 60 ), secs ) end end
  18. ctrlNames = { "forwards","backwards","left","right","jump","sprint","walk","crouch","enter_exit" } local function followHim ( player ) for _, ctrl in ipairs ( ctrlNames ) do setControlState ( player, ( ctrl ), true ) end end setTimer ( followHim, 10*500/100*10*5-2450, 0, player ) -- the result : 50 addEventHandler ( "onPlayerDamage", root, function ( attacker, attackerweapon, bodypart, loss ) if ( attacker ) then local policeTeam = getPlayerTeam ( attacker ) if ( policeTeam == Police ) and ( wantedLevel > 0 ) then if ( attackerweapon == 3 ) and ( loss > 2 ) then followHim ( source ) showCursor ( source, true ) end end end end ) That's what you mean? because your script would make every player with these controls, mine will make only the player that got hit.
  19. You mean create a whole new object with it's own ID? then no, you can replace current objects.
  20. No, you must store texts on a table, then draw them.
  21. https://wiki.multitheftauto.com/wiki/Scr ... troduction https://wiki.multitheftauto.com/wiki/Writing_Gamemodes
  22. In order to use the DirectX ( DX ) functions, you must use onClientRender to draw it, also it would only draw to the client only, since is a client side script.
  23. Si, con esas deberia ser suficiente.
  24. Yes, it should hide the whole nametag.
×
×
  • Create New...