Jump to content

Sasu

MTA Contributors
  • Posts

    1,056
  • Joined

  • Last visited

Everything posted by Sasu

  1. https://community.multitheftauto.com/index.php?p= ... tails&id=6
  2. How can I upload an image that I took with takePlayerScreenShot to a web site?
  3. The variable "GUIEditor.Grid" change to "GUIEditor.Grid[1]" and add in the script GUIEditor = { Grid = {} } Because the "." is for a subtable in a table. idk how to explain.
  4. Sasu

    Ayuda

    local msgs = { 'noob', 'murio', 'diee!' } function playerDied ( totalAmmo, killer, killerWeapon, bodypart ) if bodypart then local text = msgs [ math.random ( 1, #msgs ) ] outputChatBox ( getPlayerName ( source ) .." ".. text .." ".. getBodyPartName ( bodypart ).." !", root, 255, 255, 255, true ) end end addEventHandler ( "onPlayerWasted", getRootElement(), playerDied )
  5. Sasu

    Question

    I sent the XML to the client. Try that and tell me if it's wrong
  6. Sasu

    Ayuda

    local msgs = { 'noob', 'murio', 'diee!' } function playerDied ( totalAmmo, killer, killerWeapon, bodypart ) local text = msgs [ math.random ( 1, #msgs ) ] outputChatBox ( getPlayerName ( source ) .." ".. text .." ".. getBodyPartName ( bodypart ) or "N/A" .." !", root, 255, 255, 255, true ) end addEventHandler ( "onPlayerWasted", getRootElement(), playerDied )
  7. Show us the part of the script where you try to connect to the mysql.
  8. Sasu

    Question

    Server: addEvent("onResourceStartClient", true) addEventHandler("onResourceStartClient", root, function() triggerClientEvent("passXMLBans", source, banlist) end) addEventHandler("onPlayerJoin", root, function() setElementData(source, "PlayerIP", getPlayerIP(source)) end) Client: addEventHandler("onClientResourceStart", resourceRoot, function() triggerServerEvent("onResourceStartClient", localPlayer) end) addEvent("passXMLBans", true) addEventHandler("passXMLBans", root, function(theXML) banlist = theXML end) function getPlayerBantime( ) assert ( isElement ( localPlayer ) and getElementType ( localPlayer ) == "player", "Bad player element" ) local ip = getElementData( localPlayer, "PlayerIP" ) or "N/A" local serial = getPlayerSerial ( localPlayer ) if ( localPlayer ) then local theBans = xmlNodeGetChildren( banlist ) for i, theNode in ipairs( theBans ) do local theValueSerial = xmlNodeGetAttribute( theNode, "Serial" ) local theValueIP = xmlNodeGetAttribute( theNode, "IP" ) if ( theValueSerial == serial) or ( theValueIP == ip ) then local theValue = xmlNodeGetAttribute( theNode, "Bantime" ) return theValue else return false end end end end addEventHandler( "onClientRender", getRootElement(), function() local btime = getPlayerBantime( ) dxDrawText( btime, sx*0.2, sy*0.1, sx, sy, tocolor(255,0,0,255),(sx/1024)*0.5,"bankgothic","left","top",false,false,false ) end)
  9. Sasu

    Car Spawn

    local marker = createMarker(1573.3645019531, -1878.6141357422 , 12.2, "cylinder", 1.5, 255 ,255, 255, 155) local veh = {} function vehicle(thePlayer) if getElementType(thePlayer) == "player" then if isPedInVehicle(thePlayer) then return end if isElement( veh[thePlayer] ) then destroyElement( veh[thePlayer] ) end local x,y,z = getElementPosition(thePlayer) veh[thePlayer] = createVehicle(411, x,y,z) warpPedIntoVehicle(thePlayer, veh[thePlayer]) end end addEventHandler("onMarkerHit", marker, vehicle)
  10. Solo agrega esto: addEventHandler("onClientRender", root, function() guiSetText(L_Ping, "Ping: "..tostring(getPlayerPing(getLocalPlayer()))) end)
  11. En la linea 13, puedes cambiarlo a esto si es en el mismo recurso: stopResource(getThisResource())
  12. es una useful function... Y yo que dije?
  13. Usa la funcion useful setElementSpeed
  14. You can use this: local myCars = {} addEventHandler("onVehicleDamage", root, function() if getElementHealth(source) < 300 and not myCars[source] then myCars[source] = true setElementHealth(source, 300) setVehicleDamageProof(source, false) end end) If the car's health has less than 300 then set the vehicle damage proof to false.
  15. source is the localPlayer triggerServerEvent("subirPlayer", localPlayer) And in the line 3, I check that the player "source" is correctly.
  16. function montar() warpPedIntoVehicle(conductor, carro) outputChatBox(tostring(source)..", "..getPlayerName(source) or "Failed!!", root) try = warpPedIntoVehicle(source, carro, 4) outputChatBox(tostring(try), root) triggerClientEvent("startTravel", root, conductor) end addEvent("subirPlayer", true) addEventHandler("subirPlayer", root, montar) I have this function that is trigger when I press a button. But for any reason the warpPedIntoVehicle in line 4 returns me false. I cant warp the player to the carro who is defined with createVehicle. The warpPedIntoVehicle in line 2 works perfectly. Why the other dont work?
  17. Another easy way is using table.concat : local languages = {"English","Dutch","Test"} outputChatBox(table.concat(languages, ", "), player, 255, 0,0, true)
  18. Sasu

    Tablas...

    Puedes usr la id de las sumas de los row asi: Player[#Player+1]
  19. Sasu

    Tablas...

    No entiendo lo que dices.
  20. Sasu

    Recomendacion!

    Dijo player asi que deberia cancelar el evento onClientPlayerDamage
  21. Sasu

    missionTimer

    Replace getLocalPlayer() to root
  22. Sasu

    Turf system

    In the last update, the scripr was simplified to 150 lines.
×
×
  • Create New...