Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. getElementRotation retorna 3 argumentos, mejor usa getPedRotation. addCommandHandler ( "cp", function ( player ) local x, y, z = getElementPosition ( player ) local rot = getPedRotation ( player ) local ped1 = createPed ( 107, x, y, z, rot ) setPedAnimation ( ped1, "ped", "WALK_gang1" ) setTimer ( giveWeapon, 1000, 1, ped1, 31, 800 ) end )
  2. You must copy the themes here: "MTA San Andreas 1.3\skins\", but first, close MTA, then when you've copied the themes, you start it again.
  3. Yes, it triggers when the player get's kicked as well. You can restrict the command on the ACL, so they'll not be able to use it. Or you can use this small script to cancel the command: addEventHandler ( "onPlayerCommand", root, function ( cmd ) if ( cmd == "logout" ) then cancelEvent ( ) end end )
  4. Castillo

    fire

    addEvent ( "onZombieCreated", true ) addEventHandler ( "onZombieCreated", root, function ( ) if ( getElementModel ( source ) == 68 ) then setPedOnFire ( source, true ) setTimer ( function ( thePed ) if ( thePed and isElement ( thePed ) ) then setPedOnFire ( thePed, true ) end end ,1000, 0, source ) end end )
  5. function respawnenagua ( ) local autos = getElementsByType ( "vehicle" ) for index, auto in ipairs ( autos ) do if isElementInWater ( auto ) then respawnVehicle ( auto ) end end end addEventHandler ( "onResourceStart", resourceRoot, respawnenagua )
  6. 1: Te faltan los "end". 2: Te falta el loop.
  7. I don't understand what do you mean, I get that you're talking about the HEX color codes, but I don't get what do you want to do with them.
  8. You must use the function: moveObject.
  9. Castillo

    SQL help

    The error says that you already have a column with auto increment.
  10. You're adding the event before creating the function. closeWindowbut = guiCreateButton(168,368,114,34,"Close",false,jobWindow) function closeWindow ( button ) if ( button == "left" ) then if ( source == closeWindowbut) then guiSetVisible(jobWindow, false) showCursor(false) end end end addEventHandler ( "onClientGUIClick", closeWindowbut, closeWindow, false )
  11. You're welcome. Topic locked.
  12. onPlayerSpawn -- El evento para cuando un jugador spawnea. showPlayerHudComponent -- La funcion para mostrar/ocultar el HUD original.
  13. Cuando el jugador spawnea, ocultas el HUD de nuevo.
  14. What I understand is that you want to show the marker to the player who created it, if so you can use setElementVisibleTo. function consoleCreateMarker ( thePlayer ) local x, y, z = getElementPosition ( thePlayer ) local theMarker = createMarker ( x + 2, y + 2, z, "cylinder", 1.5, 255, 255, 0, 170 ) setElementVisibleTo ( theMarker, root, false ) -- Hide the marker to everyone. setElementVisibleTo ( theMarker, thePlayer, true ) -- Show the marker to the player. end addCommandHandler ( "createmarker", consoleCreateMarker )
  15. Yakuza.Real: No necesitas hacer eso, si no pones la IP y el puerto los auto reconecta. function reconnectAll ( thePlayer ) for index, player in ipairs ( getElementsByType ( "player" ) ) do redirectPlayer ( player ) end end addCommandHandler ( "reconnectall", reconnectAll )
  16. Te olvidaste de triggerClientEvent, no pensaras que es magico y se auto envia el dato?
  17. Tampoco, vos podes saber si soporta un jugador remoto en la wiki: https://wiki.multitheftauto.com/wiki/GetPlayerSerial Fijate que dice los argumentos para el server y el client side. En el client side solo dice: string getPlayerSerial ( ) Y en el server side dice: string getPlayerSerial ( player thePlayer )
  18. Remove "source" from the function name.
  19. --***********************************-- --***********************************-- -- Random Words -- -- By Al3grab -- --***********************************-- --***********************************-- ---- Changeable captchaNums = 5 -- captcha letters length wordTimeInSec = 25 --- the time before the word disappear in seconds [ default 11 seconds ] prizefrom,prizeto = 500,800 -- the prize random num timerfrom,timerto = 1.5,5.5 -- the random timer that shows the word [ default from 3 to 15 minutes ] ---- unChangeable wordOn = false theWord = nil thePrize = nil wordTime = wordTimeInSec * 1000 -- outputDebugString("Random Words By Al3grab | Started") -- function createCode(code,prize) for k,v in ipairs( getElementsByType("player") ) do exports.easytext:displayMessageForPlayer(v,1, "=========", wordTime, 0.07, 0.5, 0, 255, 0, 255, 1.6) exports.easytext:displayMessageForPlayer(v,2, "Word : "..code.."", wordTime, 0.07, 0.533, 255, 255, 0, 255, 1.6) exports.easytext:displayMessageForPlayer(v,3, "Prize : "..prize.."$", wordTime, 0.07, 0.563, 255, 255, 0, 255, 1.6) exports.easytext:displayMessageForPlayer(v,4, "=========", wordTime, 0.07, 0.593, 0, 255, 0, 255, 1.6) end outputChatBox("- Random Words : #FFFF00Enter the word shown below to win the prize.",root,0,255,0,true) outputChatBox("=========",root,0,255,0,true) outputChatBox("Word : "..code.."",root,255,255,0,true) outputChatBox("Prize : "..prize.."$",root,255,255,0,true) outputChatBox("=========",root,0,255,0,true) outputChatBox("- #FFFF00You can see the word down on your screen.",root,0,255,0,true) -- startCodeTimer() wordOn = true end function makeRandomCode(Word,Prize) if ( Word and Prize ) then theWord = Word thePrize = Prize else theWord = makeCaptcha(captchaNums) thePrize = math.random(prizefrom,prizeto) end if ( tostring(theWord) and tonumber(thePrize) ) then createCode(theWord,thePrize) end end function startCodeTimer() codeTimer = setTimer( function () removeCode() outputChatBox("- #FFFF00No one won the prize",root,0,255,0,true) end , wordTime , 1 ) end function removeCode() for k,v in ipairs( getElementsByType("player") ) do exports.easytext:clearMessageForPlayer(v,1) exports.easytext:clearMessageForPlayer(v,2) exports.easytext:clearMessageForPlayer(v,3) exports.easytext:clearMessageForPlayer(v,4) end if isTimer ( codeTimer ) then killTimer(codeTimer) end theWord = nil thePrize = nil wordOn = false end function makeCaptcha(capNumz) theC = "" tCode = { "a","A", "b","B", "c","C", "d","D", "e","E", "f","F", "g","G", "h","H", "j","J", "k","K", "l","L", "m","L", "n","N", "o","O", "p","P", "q","Q", "r","R", "s","S", "t","T", "u","U", "v","V", "x","X", "y","Y", "z","Z", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "!", "@", "#", "?" } for k=1,capNumz or 5 do randomCode = math.random (#tCode ) theC = ""..theC..""..tCode[randomCode].."" end return theC end function onPlayerWin ( player ) local money1 = tonumber ( getElementData ( player, "Money" ) ) local serial = getPlayerSerial ( player ) outputChatBox("* ".. getPlayerName ( player ).." #FFFF00Has won the Prize #00FF00$".. thePrize, root, 255, 255, 0, true ) setElementData ( player, "Money", money1 + thePrize ) givePlayerMoney ( player, thePrize ) executeSQLUpdate ( "MoneyB", "Money = '".. getPlayerMoney ( player ) .."'","serial = '" .. serial .. "'" ) removeCode ( ) end function detectChatMessage(msg,msgtype) if ( wordOn == true and msg and msgtype == 0 ) then if msg == theWord then onPlayerWin(source) end end end addEventHandler("onPlayerChat",root,detectChatMessage) addEventHandler("onResourceStop",resourceRoot,function() removeCode() end ) function setRandomTimer() setTimer(function() if not wordOn then makeRandomCode() end setRandomTimer() end , math.random(timerfrom,timerto) * 60 * 1000 , 1 ) end addEventHandler("onResourceStart",resourceRoot,function() setRandomTimer() easytext = getResourceFromName("easytext") if ( easytext ) then if getResourceState(easytext) == "loaded" then startResource(easytext) end else outputChatBox("* Error , need for easytext resource to start") cancelEvent() end end ) for k,v in ipairs ( {"randomcode","randomword","rw","rd"} ) do addCommandHandler(v,function(plr,cmd,prize,...) if plr and hasObjectPermissionTo(plr,"function.kickPlayer") then if ( not prize ) then makeRandomCode() else word = table.concat({...}, " ") if ( word ) then makeRandomCode(word,prize) end end end end ) end
×
×
  • Create New...