-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
This is what I do to prevent explosion: function vehicleDamage ( loss ) local vehHealth = getElementHealth ( source ) if ( vehHealth < 300 ) then setElementHealth ( source, 300 ) setVehicleDamageProof ( source, true ) end end addEventHandler ( "onVehicleDamage", root, vehicleDamage ) Of course, if it's hit by a rocket it may not reach to prevent it.
-
Weapons mod: https://community.multitheftauto.com/ind ... ls&id=5388 DONE
-
First, we make the table with many coordinates: local coordinates = { { 0, 0, 5 }, { 0, 0, 10 } } second, we make a function to get random from it: function getRandomCoordinates ( ) return unpack ( coordinates [ math.random ( #coordinates ) ] ) end And third, we use our function: x, y, z = getRandomCoordinates ( ) About the vehicle, you can use getPedOccupiedVehicle.
-
Each function does the same but with different coordinates? if so, then you should make a coordinates table and just one function.
-
The event: onPlayerJoin is server side, you should use: onClientResourceStart.
-
Si, es client side. Todas las funciones de DirectX ( DX ) o GUI son client side.
-
local optimize = true -- Should the script be optimized? (if optimized, cannot be used client-side) local ids = {} function assignID() for i=1,getMaxPlayers() do if not ids[i] then ids[i] = source setElementData(source,"id",i,not optimize) break end end end addEventHandler("onPlayerJoin",root,assignID) function startup() exports [ "scoreboard" ]:scoreboardAddColumn( "id" ) for k, v in ipairs(getElementsByType("player")) do local id = getElementData(v,"id") if id then ids[id] = v end end end addEventHandler("onResourceStart",resourceRoot,startup) function getPlayerID(player) for k, v in ipairs(ids) do if v == player then return k end end end function freeID() local id = getElementData(source,"id") if not id then return end ids[id] = nil end addEventHandler("onPlayerQuit",root,freeID) function getPlayerByID(id) local player = ids[id] return player or false end That'll add a column called "id" to the scoreboard.
-
It may be on some servers, but I don't think it's released to public, so you need to make your own.
-
That's because you didn't even add it, also, your leave script should be server side as account and isObjectInACLGroup are server side functions.
-
El dijo un grupo de ACL, no un team. aclCreateGroup
-
https://community.multitheftauto.com/ind ... ls&id=5383 https://community.multitheftauto.com/ind ... ls&id=5382 Both same resource as "realdriveby". Vehicle mods: https://community.multitheftauto.com/ind ... ls&id=5380 https://community.multitheftauto.com/ind ... ls&id=5381 DONE
-
Nothing is wrong, it should work just fine.
-
Instead of: addEventHandler You must use: addCommandHandler
-
I already posted it here: viewtopic.php?f=91&t=25460
-
You can download it from here: viewtopic.php?f=108&t=39916
-
Oh, my bad, I forgot about that part.
-
There's no command to play a stream URL, you have to make it.
-
You're welcome. P.S: We all learn from trial & error.
-
Ya encontre el error, lo que pasa es que vos estabas comparando si el nivel era: mayor o igual que 1, pero como 2 es mayor que 1, entonces iva a seguir poniendo "110", asi que tenias que comparar si era igual a 1, 2, 3, 4, etc... Copia el ultimo codigo.
-
No es de este script, ya que lo probe antes de postearlo.
-
function dxsetText ( ) local text = "" local UP = tonumber ( getElementData ( localPlayer, "level" ) ) or 0 if ( UP == 1 ) then text = "110" elseif ( UP == 2 ) then text = "160" elseif ( UP == 3 ) then text = "240" elseif ( UP == 4 ) then text = "500" elseif ( UP == 5 ) then text = "2000" elseif ( UP == 6 ) then text = "4000" elseif ( UP == 7 ) then text = "8000" elseif ( UP == 8 ) then text = "12000" elseif ( UP == 9 ) then text = "16000" elseif ( UP == 10 ) then text = "20000" end dxDrawText ( text, 676, 193, 721, 203, tocolor ( 255, 255, 255, 255 ), 1.0, "default", "left", "top", false, false, false ) end addEventHandler ( "onClientRender", root, dxsetText ) Eso funciona.
-
It has many errors. local VehMarker createMarker ( 2158, 2449, 11, "cylinder", 2, 0, 0, 255, 153 ) function spawnveh ( hitElement, matchingDimension ) local elementType = getElementType ( hitElement ) if ( elementType == "player" ) then local pteam = getPlayerTeam ( hitElement ) local pTeamName = ( pteam and getTeamName ( pteam ) or "" ) if ( pTeamName = "Police" ) then local x, y, z = getElementPosition ( hitElement ) local vehicle = createVehicle ( 597, x, y, z ) end end end addEventHandler ( "onMarkerHit", VehMarker, spawnveh ) That should work.