Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. Pone el enlance en lugar de: "musica.mp3". playSound3D es para reproducir un sonido en 3D.
  2. Eso es porque estas usando el ID de las armas, no el modelo del objeto que es lo que tenes que usar. Aca podes obtener los modelos de cada arma: https://wiki.multitheftauto.com/wiki/Weapons
  3. La foto no se ve, postea el enlance a la misma.
  4. @todd: localPlayer is the same as getLocalPlayer.
  5. La primero razon porque esta mal, es porque el nombre de la funcion esta mal puesto. function drawMyStuff ( -- Aca van los argumentos ) local baseText = getElementData(localPlayer,"baseText") -- No definistes el "player", que es obviamente el jugador local if baseText then dxDrawText(baseText,562.0,320.0,727.0,340.0,tocolor(255,255,255,255),1.4,"default","left","top",false,false,false) end end addEventHandler("onClientRender",root,drawMyStuff)
  6. As far as I know, restriction system was never implemented on the spawn system.
  7. Topic moved to "Support for MTA:SA 1.x > Server".
  8. Castillo

    Skin

    You can unload the replaced skin with Scripting functions.
  9. Topic moved to Scripting section.
  10. Weapon mod: https://community.multitheftauto.com/index.php?p= ... ls&id=4372
  11. Castillo

    Open Panel

    setElementData (getRootElement(), "adminclickopen", false) setElementData (getRootElement(), "adminclickmousebind", false) function clickmenu (mouseButton, buttonState, clickedElement, worldPosX, worldPosY, worldPosZ, screenPosX, screenPosY) if ( buttonState == "down" ) then if ( getPlayerTeam ( source ) and getTeamName ( getPlayerTeam ( source ) ) == "Police" ) then if ( not getElementData ( source, "adminclickopen" ) ) then if ( getElementData ( source, "adminclickmousebind") ) then if ( mouseButton == "right" ) then if ( clickedElement ) then if ( getElementType (clickedElement) == "player" ) then name = getPlayerName (clickedElement) setElementData ( source, "adminclickselplayer", tostring(name) ) setElementData ( source, "adminclickopen", true) triggerClientEvent (source,"playermenu", getRootElement() ) elseif ( getElementType (clickedElement) == "vehicle" ) then thecar = clickedElement setElementData ( source, "adminclickselplayer", thecar ) triggerClientEvent (source,"carmenu", getRootElement() ) end end elseif ( mouseButton == "left" ) then --outputChatBox ( worldPosX .. "," .. worldPosY .. "," .. worldPosZ ) --[[ Random send cars & players flying, can be abused col = createColCircle ( worldPosX, worldPosY, 15) colelements = getElementsWithinColShape (col) for theKey,theElement in ipairs(colelements) do if ( getElementType (theElement) == "player" ) then setElementVelocity ( theElement, 2, 0, 5) elseif ( getElementType (theElement) == "vehicle" ) then setElementVelocity ( theElement, 2, 0, 1.5) end end --]] end end end end end end addEventHandler( "onPlayerClick", getRootElement(), clickmenu ) function onstart() players = getElementsByType ( "player" ) -- get a table of all the players in the server for theKey,player in ipairs(players) do if ( hasObjectPermissionTo ( player, "function.kickPlayer", true ) ) then setElementData ( player, "adminclickopen", false) setElementData ( player, "adminclickmousebind", false) bindKey (player, "o", "down", showmouse, player ) end end end addEventHandler ( "onResourceStart", getRootElement(), onstart ) function showmouse ( player ) showCursor ( player, not isCursorShowing ( player ) ) setElementData ( player, "adminclickmousebind", isCursorShowing ( player ) ) end function bindmouse () if ( hasObjectPermissionTo ( source, "function.kickPlayer", true ) ) then setElementData ( source, "adminclickopen", false ) setElementData ( source, "adminclickmousebind", false ) bindKey ( source, "o", "down", showmouse ) end end addEventHandler ("onPlayerLogin", getRootElement(), bindmouse ) function killplayer () victimemt = getElementData ( source, "adminclickselplayer" ) victim = getPlayerFromName (tostring(victimemt)) if ( isElement(victim) ) then killPed (victim) outputChatBox ("You just killed " .. victimemt, source, 125, 125, 125 ) outputChatBox ("You just admin killed!", victim, 125, 125, 125 ) else outputChatBox ("This player is no longer connected.", source, 255, 0, 0 ) end end addEvent("killplayer", true) addEventHandler ("killplayer", getRootElement(), killplayer) function muteplayer () victimemt = getElementData ( source, "adminclickselplayer" ) victim = getPlayerFromName (tostring(victimemt)) if ( isElement(victim) ) then if ( getElementData ( victim, "muted" ) == false ) then setPlayerMuted ( victim, true ) setElementData (victim, "muted", true) outputChatBox ("You just muted " .. victimemt, source, 125, 125, 125 ) outputChatBox ("You just got muted.", victim, 125, 125, 125 ) elseif ( getElementData ( victim, "muted" ) == true ) then setPlayerMuted ( victim, false ) setElementData (victim, "muted", false) outputChatBox ("You just unmuted " .. victimemt, source, 125, 125, 125 ) outputChatBox ("You just got unmuted.", victim, 125, 125, 125 ) end else outputChatBox ("This player is no longer connected.", source, 255, 0, 0 ) end end addEvent("mute", true) addEventHandler ("mute", getRootElement(), muteplayer) function freezeplayer () victimemt = getElementData ( source, "adminclickselplayer" ) victim = getPlayerFromName (tostring(victimemt)) if ( isElement(victim) ) then if ( getElementData ( victim, "froozen" ) == false ) then toggleAllControls ( victim, false, true, false ) setElementData (victim, "froozen", true) outputChatBox ("You just freezed " .. victimemt, source, 125, 125, 125 ) outputChatBox ("You just got freezed.", victim, 125, 125, 125 ) elseif ( getElementData ( victim, "froozen" ) == true ) then toggleAllControls ( victim,true,true,true ) setElementData (victim, "froozen", false) outputChatBox ("You're now free to move " .. victimemt, source, 125, 125, 125 ) outputChatBox ("You just got un-froozen.", victim, 125, 125, 125 ) end else outputChatBox ("This player is no longer connected.", source, 255, 0, 0 ) end end addEvent("freeze", true) addEventHandler ("freeze", getRootElement(), freezeplayer) function banplayer (reason) victimemt = getElementData ( source, "adminclickselplayer" ) victim = getPlayerFromName (tostring(victimemt)) if ( isElement(victim) ) then banPlayer ( victim, true, true, true, getRootElement(), tostring(reason), 20) outputChatBox ("You just banned " .. victimemt, source, 125, 125, 125 ) outputChatBox ( getPlayerName(source) .. " has just banned " .. victimemt .. " for: " .. tostring(reason), source, 255, 0, 0 ) else outputChatBox ("This player is no longer connected.", source, 255, 0, 0 ) end end addEvent("ban", true) addEventHandler ("ban", getRootElement(), banplayer) function kickplayer (reason) victimemt = getElementData ( source, "adminclickselplayer" ) victim = getPlayerFromName (tostring(victimemt)) if ( isElement(victim) ) then kickPlayer ( victim, getRootElement(), reason) outputChatBox ("You just kicked " .. victimemt, source, 125, 125, 125 ) outputChatBox ( getPlayerName(source) .. " has just kicked " .. victimemt .. " for: " .. tostring(reason), source, 255, 0, 0 ) else outputChatBox ("This player is no longer connected.", source, 255, 0, 0 ) end end addEvent("kick", true) addEventHandler ("kick", getRootElement(), kickplayer) addEvent ( "destroyVehicle", true ) addEventHandler ( "destroyVehicle", root, function ( theVehicle ) if ( theVehicle ) then destroyElement ( theVehicle ) setElementData ( source, "adminclickselplayer", nil ) end end )
  12. I'm not sure if this is what do you mean: items = { { [ "category" ] = "Weapons", [ "name" ] = "M4", [ "price" ] = 1000, [ "quantity" ] = 500 }, { [ "category" ] = "Skills", [ "name" ] = "M4 Skill", [ "price" ] = 2000, [ "quantity" ] = 1000 } }
  13. There's an application called: "iLuaBox".
  14. Oh, I was just asking, you should be a little more creative and do your own style . Let's stop doing off-topic.
  15. @Draken: You really created the function: "xml:GetNodeValue" ? because you've used "uLoaded, uNode", that's Kenix style.
  16. https://github.com/mabako/mta-paradise/downloads
  17. Castillo

    GUI Help

    I'm afraid I don't understand you, what do you mean by replacement?
  18. No estoy seguro si tiene un limite el element data.
  19. Talvez te falten datos o el host este mal, tambien podes intentar poner el puerto correcto.
  20. Castillo

    playSound3D

    How do you expect a script to work if you don't even define the variables you are using?
  21. La unica manera es editar el script, y la verdad no te lo recomiendo aun, es muy dificil para un principiante ( sin ofender ).
  22. El recurso "guieditor" se usa para diseñar tus interfaces mas facil y rapido, yo lo uso para todos mis diseños. https://community.multitheftauto.com/index.php?p= ... ils&id=141
  23. Castillo

    MySql help

    Because he's using MTA paradise, he would need to re-script most of scripts to implement it.
×
×
  • Create New...