-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
I think the resource "mysql" is not running, but I'm not sure.
-
Si todos fuesen como yo o Benxamix, entonces seria MUY pero MUY aburrido.
-
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.
-
That's just a mess. You want to set +1 win point to the player with rank #1?
-
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)
-
Post your script, how do you expect us to help if you don't?
-
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.
-
That's because you named your function as "setTimer". function onStart() -- Here. setTimer(start, 1000, 1, player) end addEventHandler("onClientResourceStart", resourceRoot, onStart)
-
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?
-
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
-
Simbad de Zeeman was just joking as far as I know .
-
@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.
-
What do you mean? and what doesn't work?
-
The "zombies" by Slothman already has a "Zombie kills" scoreboard column.
-
-- 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)
-
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)
-
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 .
-
Usa la funcion: toggleControl("fire", false)
-
Ah, si, me olvide de eso. P.D: De nada.
-
myonlake's code doesn't also output the "usage" message either.
-
Well, it's better without it than nothing, right?
-
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.
-
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
-
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
