Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. I think the resource "mysql" is not running, but I'm not sure.
  2. Castillo

    Me cansé

    Cierren este post. Cerrado.
  3. Castillo

    Me cansé

    Si todos fuesen como yo o Benxamix, entonces seria MUY pero MUY aburrido.
  4. Well, I suggest you to think when you're scripting, because you're just trying to set/get element data into a string, number value.
  5. That's just a mess. You want to set +1 win point to the player with rank #1?
  6. function start(player) crate = createObject(2991,-1353,-185,14) local team = getPlayerTeam(player) local object = createObject(2991, -1353, -185, 14) if team then local police = getTeamFromName("Police") local criminals = getTeamFromName("Criminals") if (team == police) then outputChatBox("You're a police officer.", player, 0, 255, 0, false) elseif (team == criminal) then outputChatBox("You're a criminal.", player, 0, 255, 0, false) end end end function onStart(player) setTimer(function () for index, player in ipairs(getElementsByType("player")) do start(player) end end, 7500, 1) end addEventHandler("onResourceStart", resourceRoot, onStart)
  7. Post your script, how do you expect us to help if you don't?
  8. Mind explaining what exactly are you trying to achieve? because I can't really help if I don't know what are you up to.
  9. That's because you named your function as "setTimer". function onStart() -- Here. setTimer(start, 1000, 1, player) end addEventHandler("onClientResourceStart", resourceRoot, onStart)
  10. According to your script, a server-side script is triggering "setNextMap" and "setNextNil". These events should change the next map variable to the one sent, could you post the server-side script where you trigger these events?
  11. function(player) local pRank = exports["race"]:getPlayerRank(player) if (pRank == "1" or pRank == 1) then setPlayerMoney(player, 1000)----Its only an example, i need how to call the player rank when its 1. end end
  12. Simbad de Zeeman was just joking as far as I know .
  13. @Xeno: You got that from here: viewtopic.php?f=91&t=35621&p=368094 . @zombienation: That script will save the zombie kills each time you kill somene, and then load on login.
  14. Castillo

    HELPP!!

    What do you mean? and what doesn't work?
  15. The "zombies" by Slothman already has a "Zombie kills" scoreboard column.
  16. -- client side. addEventHandler("onClientPlayerDamage", localPlayer, function (attacker, weapon, bodypart, loss) if (attacker and getElementType(attacker) == "player" and weapon == 41) then local team = getPlayerTeam(attacker) if (team and getTeamName(team) == "Medicos") then cancelEvent() if (not isTimer(timer)) then local health = getElementHealth(localPlayer) if (health < 99) then triggerServerEvent("medic_heal", localPlayer, attacker) timer = setTimer(function() end, 1000, 1) end end end end end) -- server side: addEvent("medic_heal", true) addEventHandler("medic_heal", root, function (medic) if (getElementHealth(source) < 100) then local newHP = getElementHealth(source) + 20 setElementHealth(source, newHP) if (newHP > 100) then setElementHealth(source, 100) end givePlayerMoney(medic, 100) takePlayerMoney(source, 100) end end)
  17. Para cambiar el arma al slot 0: https://wiki.multitheftauto.com/wiki/SetPedWeaponSlot Se usa el Spray Can ID: 41, pero cancelamos el daño en onClientPlayerDamage. Ejemplo de como lo hice en el servidor SAUR: -- client side: addEventHandler("onClientPlayerDamage", localPlayer, function (attacker, weapon, bodypart, loss) if (attacker and getElementType(attacker) == "player" and weapon == 41) then local team = getPlayerTeam(attacker) if (team and getTeamName(team) == "Medic") then cancelEvent() end end end)
  18. I agree, we don't know what's inside the BaseMode scripts, if we want something different, we can't change it. I like your idea, good luck with it .
  19. Usa la funcion: toggleControl("fire", false)
  20. Ah, si, me olvide de eso. P.D: De nada.
  21. Castillo

    /me command

    myonlake's code doesn't also output the "usage" message either.
  22. Castillo

    /me command

    Well, it's better without it than nothing, right?
  23. As I said, these "()" in the "if" statement won't make any effect, I have scripts without that and works perfectly fine. Maybe it was working before, but you didn't know.
  24. Castillo

    /me command

    I don't know why you need to add a new command, you can replace the "/me" command. addEventHandler('onPlayerChat', getRootElement(), function(message, messageType) if (messageType == 1) then local posX, posY, posZ = getElementPosition(source) for index , _player in pairs ( getElementsByType ( "player" ) ) do if isPlayerInRangeOfPoint ( _player , posX , posY , posZ , 20 ) then outputChatBox('* ' .. getPlayerName(source) .. ' ' .. message, _player, 194, 162, 218) end end cancelEvent() end end) function isPlayerInRangeOfPoint ( player , posX , posY , posZ , range ) local _posX , _posY , _posZ = getElementPosition ( player ) return ( ( posX - _posX ) ^ 2 + ( posY - _posY ) ^ 2 + ( posZ - _posZ ) ^ 2 ) ^ 0.5 <= range end
  25. function destroyEmptyVehicles() local vehicles = getElementsByType ( "vehicle" ) for index, vehicle in ipairs ( vehicles ) do if isEmpty( vehicle ) then destroyElement( vehicle ) end end end setTimer(destroyEmptyVehicles, 3600000, 0) addCommandHandler("vdoom", destroyEmptyVehicles) function isEmpty( vehicle ) local passengers = getVehicleMaxPassengers( vehicle ) if type( passengers ) == 'number' then for seat = 0, passengers do if getVehicleOccupant( vehicle, seat ) then return false end end end return true end
×
×
  • Create New...