Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. Si tenes la experiencia para hacerlo, entonces es mejor hacerlo tu mismo, asi sabes como funciona, si tiene un error, lo podes llegar a arreglar sin problemas.
  2. Castillo

    Need help

    This script will give $100 each time you kill a zombie. addEvent ( "onZombieWasted", true ) addEventHandler ( "onZombieWasted", root, function ( killer ) if ( killer and getElementType ( killer ) == "player" ) then givePlayerMoney ( killer, 100 ) end end ) About the zombies just in one zone, you could set the spawn method to spawnpoints and then create them where you want.
  3. 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 isObjectInACLGroup ( "user.".. getAccountName ( getPlayerAccount ( source ) ), aclGetGroup ( "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 ) Try that.
  4. Castillo

    Skin

    Is not possible, it may never be.
  5. @Alexs_Steel: Dijo un team, no un grupo de ACL . @Alejandro: Usa: getPlayerTeam -- Para obtener el elemento de team de un jugador. getTeamName -- Para obtener el nombre de un element de team ( lo que obtenes con la funcion de arriva ).
  6. Castillo

    Open Panel

    Post your whole script.
  7. Castillo

    Animaciones

    Esa suele ser la mejor opcion si tenes la experiencia, buen trabajo . Cierro el tema asi no postean sin necesidad.
  8. Mira, vos haces cosas aleatorias y queres que los de mas te hagan el verdadero script, empeza a estudiar como funciona Lua.
  9. local Dinero = { 12000, 23000, 18000 } function radarArea ( thePlayer, cmd ) local money = getPlayerMoney ( thePlayer ) local randomMoney = Dinero[ math.random ( #Dinero ) ] if ( money >= randomMoney ) then local posX, posY, posZ = getElementPosition ( thePlayer ) local BaseRadar = createRadarArea ( posX, posY, -40, -40, 0, 255, 0, 0 ) takePlayerMoney ( thePlayer, randomMoney ) outputChatBox ( "Base creada!", thePlayer, 0, 255, 0 ) else outputChatBox ( "Usted no tiene $".. randomMoney .."!", thePlayer, 255, 0, 0 ) end end addCommandHandler ( "startbase", radarArea ) Le agregue dos mensajes, si no tenes dinero, te lo dice, si tenes, te dice que se creo, el tamaño debe estar mal.
  10. Off topic: Es mi usuario en https://community.multitheftauto.com/ .
  11. local Dinero = { 12000, 23000, 18000 } function radarArea ( thePlayer, cmd ) local money = getPlayerMoney ( thePlayer ) local randomMoney = Dinero[ math.random ( #Dinero ) ] if ( money >= randomMoney ) then local posX, posY, posZ = getElementPosition ( thePlayer ) local BaseRadar = createRadarArea ( posX, posY, -40, 40, 0, 255, 0, 0 ) takePlayerMoney ( thePlayer, randomMoney ) end end addCommandHandler ( "startbase", radarArea )
  12. getPlayerMoney -- Para verificar si el jugador tiene ese dinero. takePlayerMoney -- Para sacarle el dinero al jugador.
  13. Eso esta todo mal. function radarArea ( thePlayer, cmd, width, height ) local width, height = tonumber ( width ), tonumber ( height ) local posX, posY, posZ = getElementPosition ( thePlayer ) local BaseRadar = createRadarArea ( posX, posY, width, height, 0, 255, 0, 175 ) end addCommandHandler ( "startbase", radarArea ) Comando: /startbase
  14. Maybe you created it on a wrong position, try re-creating it.
  15. local medicPed = createPed ( 275, 1178, -1327, 14 ) paramedicGui = guiCreateWindow(704,317,533,326,"Paramedic ",false) paramedicMemo = guiCreateMemo(9,0,1,1,"text",false,paramedicGui) paramedicLabel = guiCreateLabel(7,27,521,25,"Paramedic Job Information",false,paramedicGui) guiLabelSetHorizontalAlign(paramedicLabel,"center",false) guiSetFont(paramedicLabel,"clear-normal") paramedicAccept = guiCreateButton(143,290,107,27,"Accept",false,paramedicGui) paramedicClose = guiCreateButton(292,289,107,28,"Close",false,paramedicGui) --additions guiSetVisible ( paramedicGui, false ) guiMemoSetReadOnly ( paramedicMemo, true ) guiWindowSetSizable ( paramedicGui, false ) function medicClick ( button, state, absX, absY, wx, wy, wz, element ) if ( element and element == medicPed ) then guiSetVisible ( paramedicGui, true ) end end addEventHandler ( "onClientClick", getRootElement(), medicClick ) bindKey ( "K", "down", function ( ) showCursor ( not isCursorShowing ( ) ) end ) Your GUI elements we're set to Relative, but they we're Relative.
  16. Si, es type="server". P.D: Es Solidsnake14, no Castillo14 .
  17. Porque no lees el sintaxis de la funcion? ahi lo explica todo.
  18. Vas a tener que crear un colshape tambien, podes usar: createColRectangle Vas a tener que estudiar lo basico de Lua, asi que te recomiendo que mires estas paginas: http://development.mtasa.com/wiki/ES/In ... %B3n_a_Lua http://lua-users.org/wiki/TutorialDirectory http://www.lua.org/pil/index.html
  19. Castillo

    Nothing?

    Done, added some comments.
  20. Castillo

    Flag

    Tenes que crear tu propio sistema, podes buscar aca: https://community.multitheftauto.com/, talvez alguien subio algo asi.
  21. Castillo

    Nothing?

    texts = {} texts["Overview"] = "texthere" texts["Rules"] = "texthere" texts["FAQ"] = "texthere" -- Your GUI buttons we're set to Absolute, but they we're Relative. -- true = Absolute -- false = Relative docWindow = guiCreateWindow(0.3672,0.3306,0.2823,0.2481,"Information Panel",true) docOverview = guiCreateButton(13,24,92,38,"Overview",false,docWindow) docRules = guiCreateButton(13,85,92,38,"Rules",false,docWindow) docFAQ = guiCreateButton(14,145,92,38,"FAQ",false,docWindow) docClose = guiCreateButton(17,208,92,38,"Close",false,docWindow) docMemo = guiCreateMemo(121,29,410,227,texts["Overview"],false,docWindow) guiSetVisible(docWindow,false) bindKey("F1","down", function ( ) guiSetVisible ( docWindow, not guiGetVisible ( docWindow ) ) showCursor ( guiGetVisible ( docWindow ) ) end ) function setText ( ) if ( source == docClose ) then -- You had a type here: "soruce" instead of "source". Also you we're checking if the button you've press was "docClose" instead of docClose ( you have to check the element, not the string. ) guiSetVisible ( docWindow, false ) showCursor ( false ) return end local text = guiGetText ( source ) guiSetText ( docMemo, texts[ text ] ) end addEventHandler("onClientGUIClick",docOverview,setText,false) addEventHandler("onClientGUIClick",docRules,setText,false) addEventHandler("onClientGUIClick",docFAQ,setText,false) addEventHandler("onClientGUIClick",docClose,setText,false)
×
×
  • Create New...