
dragonofdark
Members-
Posts
203 -
Joined
-
Last visited
Everything posted by dragonofdark
-
Siren on other cars than police, fire and EMS
dragonofdark replied to dragonofdark's topic in Scripting
Hey, I restart this topic because I have a sort of problem. I have 2 function : 1 to start the siren, 1 to stop the siren. How can I make a toogle function with one keybind ? function 1 = siren1 function 2 = siren10 Thanks -
Hello, I want for my members to see what is their factions when then do /getfaction . As my faction system use SQL I need to make an exported function. The exported function is : function getPlayerFactions( player ) return p[ player ] and p[ player ].factions or false end Thanks, dragonofdark
-
Hm.. I put setCameraMatrix ( player, x, y, z + 4, x, y, z) before setVehicleFrozen( veh, true ) setElementDimension( player, getElementDimension( other ) ) And my vehicle is damaged anyway.
-
Could you place the setCameraMatrix ? I don't really know where to put it
-
The freeze changes nothing. Here is the script : if ( not veh ) then setElementDimension( player, getElementDimension( other ) ) setElementInterior( player, getElementInterior( other ) ) setCameraInterior( player, getElementInterior( other ) ) setElementPosition( player, getElementPosition( other ) ) setCameraTarget( player, player ) else setVehicleFrozen( veh, true ) setElementDimension( player, getElementDimension( other ) ) setElementInterior( player, getElementInterior( other ) ) setCameraInterior( player, getElementInterior( other ) ) setElementPosition( player, getElementPosition( other ) ) setCameraTarget( player, player ) local x,y,z = getElementPosition (other) setElementDimension( veh, getElementDimension( other ) ) setElementInterior( veh, getElementInterior( other ) ) setElementPosition( veh, x,y,z+0.3 ) setTimer( setVehicleFrozen, 500, 1, veh, false ) end
-
Hello, I would like to make some garages with interiors so I made teleporters. The problem is when I teleport with a vehicle, it breaks and it take fire. If I teleport with a bike, I fall of it and the bike breaks. The vehicles don't touch the ground after the teleporting. What could be the problem with that ?
-
Thanks you two It works great.
-
Hello, Here is my problem : I have this line : setElementPosition( veh, getElementPosition( other ) ) I would like to add 2 to z, how can I make that ? (other is a teleporter's marker, and the vehicles spawn througt the ground. Thanks.
-
Thanks Aibo
-
Hello, I would like to make an automatic radar wich fade the player's screen for 0.5 secondes if his vehicle's speed is > than 90 km/h. I took the code wich calculate the vehicle's speed in km/h in the MTA-paradise speedometer but it seem to dont work. Here is my code : myMarker1 = createMarker(1630.8,154.3,34.1,"cylinder",15,255,255,10,0) function MarkerHit1 ( hitElement, matchingDimension ) if getElementType( hitElement ) == "vehicle" then vehicle = hitElement controller = getVehicleController ( vehicle ) speed = ( function( x, y, z ) return math.floor( math.sqrt( x*x + y*y + z*z ) * 155 ) end )( getElementVelocity( vehicle ) ) function vitesse () if speed then if speed > 90 then function flash (controller) fadeCamera ( controller, false, 1.0, 0, 0, 0, 255 ) setTimer ( fadeCamera, 500, 0.5, controller, true, 0.5) end end end end end end addEventHandler( "onMarkerHit", myMarker1, MarkerHit1 ) My screen don't fade if I pass at 110mk/h on the marker. Could you help me ? Thanks.
-
Seul le editor_dump doit être supprimé
-
Notre serveur est un RP strict, et n'est pas totalement un Gamemode tout fait (j'ai repris MTA-Paradise mais je le modifie et fais mes propres scripts => Paradise était une aide ) Mais le serveur n'est pas totalement finni. Tu peux quand même venir sur notre forum pour suivre l'avancement : http://groupe-tgmc.legtux.org/mta/forum/ Bye bye
-
Siren on other cars than police, fire and EMS
dragonofdark replied to dragonofdark's topic in Scripting
Thanks a lot Solidsnake14 -
Siren on other cars than police, fire and EMS
dragonofdark replied to dragonofdark's topic in Scripting
Thanks I just added a forget "b" at line 7. Well, now I have the error ERRROR: sirenes/sirene_server.lua:6: bad argument #1 to 'pairs' (table expected, got nil) I never worked with the tables so it's a bit difficult for me to find the problem -
Siren on other cars than police, fire and EMS
dragonofdark replied to dragonofdark's topic in Scripting
Hey, Sorry if I restart the topic but I have changed some things in the script to make the sirens turnables with binds and I have an error. So, my server script is : ambulances = { [416]=true } perso = { urgences=true } -- sirenes ambu function sirenAmbu1 ( player ) local commandant = getPedOccupiedVehicle(player) if ( ambulances[getVehicleID ( source )] ) and ( perso[getPlayerTeam" class="kw2">getPlayerTeam" class="kw2">getPlayerTeam ( player )] ) then triggerClientEvent ( "sirenAmbu1", getRootElement(), commandant ) end end bindKey ( "num_1", "down", function () sirenAmbu1 end, false ) But when I start the resource, I have this error : WARNING: Loading script failed: siernes/sirene_server.lua:11: "=" expected near 'end' Can someone help me to make it work ? Thanks EDIT : Hum... The code bugs on this forum O_o -
Thanks DakiLLa, it works well
-
Hello, I made a little script wich create some objects in my Walton, so I have a command to create the objects and an other to destroy them. But when I destroy the objects, my Walton healt is at 250 To prevent that, I created a function wich fix the vehicle after the destroy. I set a timer of 1.5 sec before the function works. Here is the script : -- create the bags in the walton function sacWal1( player, cmd ) local wal = getPedOccupiedVehicle(player) local x,y,z = getElementPosition( wal ) o1 = createObject ( 2060, x, y, z ) o2 = createObject ( 2060, x, y, z ) o3 = createObject ( 2060, x, y, z ) o4 = createObject ( 2060, x, y, z ) o5 = createObject ( 2060, x, y, z ) o6 = createObject ( 2060, x, y, z ) o7 = createObject ( 2060, x, y, z ) o8 = createObject ( 2060, x, y, z ) o9 = createObject ( 2060, x, y, z ) o10 = createObject ( 2060, x, y, z ) o11 = createObject ( 2060, x, y, z ) o12 = createObject ( 2060, x, y, z ) o13 = createObject ( 2060, x, y, z ) o14 = createObject ( 2060, x, y, z ) o15 = createObject ( 2060, x, y, z ) o16 = createObject ( 2060, x, y, z ) o17 = createObject ( 2060, x, y, z ) o18 = createObject ( 2060, x, y, z ) o19 = createObject ( 2060, x, y, z ) o20 = createObject ( 2060, x, y, z ) o21 = createObject ( 2060, x, y, z ) o22 = createObject ( 2060, x, y, z ) o23 = createObject ( 2060, x, y, z ) o24 = createObject ( 2060, x, y, z ) o25 = createObject ( 2060, x, y, z ) o26 = createObject ( 2060, x, y, z ) o27 = createObject ( 2060, x, y, z ) o28 = createObject ( 2060, x, y, z ) o29 = createObject ( 2060, x, y, z ) o30 = createObject ( 2060, x, y, z ) o31 = createObject ( 2060, x, y, z ) o32 = createObject ( 2060, x, y, z ) o33 = createObject ( 2060, x, y, z ) o34 = createObject ( 2060, x, y, z ) o35 = createObject ( 2060, x, y, z ) o36 = createObject ( 2060, x, y, z ) o37 = createObject ( 2060, x, y, z ) o38 = createObject ( 2060, x, y, z ) o39 = createObject ( 2060, x, y, z ) o40 = createObject ( 2060, x, y, z ) o41 = createObject ( 2060, x, y, z ) attachElements ( o1, wal, -0.5, -0.1 , -0.35 ) attachElements ( o2, wal, 0.5, -0.1 , -0.35 ) attachElements ( o3, wal, -0.5, -0.6 , -0.35 ) attachElements ( o4, wal, 0.5, -0.6 , -0.35 ) attachElements ( o5, wal, -0.5, -1.1 , -0.35 ) attachElements ( o6, wal, 0.5, -1.1 , -0.35 ) attachElements ( o7, wal, -0.5, -1.6 , -0.35 ) attachElements ( o8, wal, 0.5, -1.6 , -0.35 ) attachElements ( o9, wal, -0.5, -2.1 , -0.35 ) attachElements ( o10, wal, 0.5, -2.1 , -0.35 ) attachElements ( o11, wal, -0.5, -2.55 , -0.35 ) attachElements ( o12, wal, 0.5, -2.55 , -0.35 ) attachElements ( o13, wal, -0.5, -0.1 , -0.1 ) attachElements ( o14, wal, 0.5, -0.1 , -0.1 ) attachElements ( o15, wal, -0.5, -0.6 , -0.1 ) attachElements ( o16, wal, 0.5, -0.6 , -0.1 ) attachElements ( o17, wal, -0.5, -1.1 , -0.1 ) attachElements ( o18, wal, 0.5, -1.1 , -0.1 ) attachElements ( o19, wal, -0.5, -1.6 , -0.1 ) attachElements ( o20, wal, 0.5, -1.6 , -0.1 ) attachElements ( o21, wal, -0.5, -2.1 , -0.1 ) attachElements ( o22, wal, 0.5, -2.1 , -0.1 ) attachElements ( o23, wal, -0.5, -2.55 , -0.1 ) attachElements ( o24, wal, 0.5, -2.55 , -0.1 ) attachElements ( o25, wal, -0.5, -0.1 , 0.1 ) attachElements ( o26, wal, 0.5, -0.1 , 0.1 ) attachElements ( o27, wal, -0.5, -0.6 , 0.1 ) attachElements ( o28, wal, 0.5, -0.6 , 0.1 ) attachElements ( o29, wal, -0.5, -1.1 , 0.1 ) attachElements ( o30, wal, 0.5, -1.1 , 0.1 ) attachElements ( o31, wal, -0.5, -1.6 , 0.1 ) attachElements ( o32, wal, 0.5, -1.6 , 0.1 ) attachElements ( o33, wal, -0.5, -2.1 , 0.1 ) attachElements ( o34, wal, 0.5, -2.1 , 0.1 ) attachElements ( o35, wal, -0.5, -2.55 , 0.1 ) attachElements ( o36, wal, 0.5, -2.55 , 0.1 ) attachElements ( o37, wal, 0, -0.35 , 0.35 ) attachElements ( o38, wal, 0, -0.85 , 0.35 ) attachElements ( o39, wal, 0, -1.35 , 0.35 ) attachElements ( o40, wal, 0, -1.85 , 0.35 ) attachElements ( o41, wal, 0, -2.35 , 0.35 ) setTimer ( fix, 1500, 1 ) end addCommandHandler ( "sacwal1", sacWal1) -- delete the bags function sacWal10 ( player, cmd ) local wal = getPedOccupiedVehicle(player) local x,y,z = getElementPosition( wal ) destroyElement ( o1 ) destroyElement ( o2 ) destroyElement ( o3 ) destroyElement ( o4 ) destroyElement ( o5 ) destroyElement ( o6 ) destroyElement ( o7 ) destroyElement ( o8 ) destroyElement ( o9 ) destroyElement ( o10 ) destroyElement ( o11 ) destroyElement ( o12 ) destroyElement ( o13 ) destroyElement ( o14 ) destroyElement ( o15 ) destroyElement ( o16 ) destroyElement ( o17 ) destroyElement ( o18 ) destroyElement ( o19 ) destroyElement ( o20 ) destroyElement ( o21 ) destroyElement ( o22 ) destroyElement ( o23 ) destroyElement ( o24 ) destroyElement ( o25 ) destroyElement ( o26 ) destroyElement ( o27 ) destroyElement ( o28 ) destroyElement ( o29 ) destroyElement ( o30 ) destroyElement ( o31 ) destroyElement ( o32 ) destroyElement ( o33 ) destroyElement ( o34 ) destroyElement ( o35 ) destroyElement ( o36 ) destroyElement ( o37 ) destroyElement ( o38 ) destroyElement ( o39 ) destroyElement ( o40 ) destroyElement ( o41 ) setTimer ( fix, 1500, 1 ) end addCommandHandler ( "sacwal10", sacWal10) -- fix the vehicle function fix () local wal = getPedOccupiedVehicle(player) fixVehicle ( wal ) end After that, i have 2 errors in the debugscript : i hope someone can help me Thanks in advance, dragonofdark
-
No one could help me ?
-
Hello, Sorry for the bumping but.. Could I have the ID of the gate at K.A.C.C. Military Fuels ? I can't find it in the garages ID's... Thanks
-
Find a vehicle paintjob ID + Problem with modified things
dragonofdark replied to dragonofdark's topic in Scripting
No, I didn't. I'll test that so -
Find a vehicle paintjob ID + Problem with modified things
dragonofdark replied to dragonofdark's topic in Scripting
Thanks anyway, and hum... How can I find the textures of an object with IMG tool ? Because I would like to change the textures of some objects but their TXD haven't got the same name... -
Find a vehicle paintjob ID + Problem with modified things
dragonofdark replied to dragonofdark's topic in Scripting
1. I've fixed the SKIN but now I have just the second error : WARNING: skins\replace.lua:4: bad 'number' pointer @ 'engineReplaceModel'(2) The script : txd = engineLoadTXD ( "278.txd" ) engineImportTXD ( txd, 278 ) dff = engineLoadDFF ( "278.dff", 0 ) engineReplaceModel ( dff, 278 ) The meta : <meta> <info type="misc" name="Skins pour les services d'urgence" author="dragonofdark" description="" version="1" /> <script src="replace.lua" type="client" /> <file src="278.dff" /> <file src="278.txd" /> </meta> 2.I've changed the col of the tanker and I have this error : The script : txd = engineLoadTXD("514.txd") engineImportTXD(txd, 514) dff = engineLoadDFF("514.dff", 514) engineReplaceModel(dff, 514) col = engineLoadCOL ("514.col") engineReplaceCOL(col, 514) The meta : <meta> <info type="misc" name="Tanker" author="dragonofdark" description="" version="1" /> <file src="514.txd" /> <file src="514.dff" /> <file src="514.col" /> <script type="client" src="replace.lua" /> </meta> -
Hello, Firstly, I have a problem with the engine functions... I want to modify some textures and a model, but when the resource starts, I have some errors in the debugscript My script is client-side and is : for SKIN : txd = engineLoadTXD ( "skins\\278.txd" ) engineImportTXD ( txd, 278 ) dff = engineLoadDFF ( "skins\\278.dff", 278 ) engineReplaceModel ( dff, 278 ) for TANKER : txd = engineLoadTXD("514.txd") engineImportTXD(txd, 514) dff = engineLoadDFF("514.dff", 514) engineReplaceModel(dff, 514, replaceCol) Secondly, I want to modify some vehicles paintjobs but how can I find the texture ID to remplace it ? Thanks a lot in advance, dragonofdark
-
Oh damn.. That was that the error. I don't must put the "player" element
-
Hello, I have a script to switch vehicles indicators on/off. But to in this script, I must do /indicator_left or /indicator_right to switch them. It's boring to do every time the command to switch them so I would like to make some binds to switch them. So the old commands are addCommandHandler('indicator_left', function () switchIndicatorState('left') end, false) addCommandHandler('indicator_right', function () switchIndicatorState('right') end, false) And the new commands are bindKey ( player, ",", "down", function () switchIndicatorState('left') end, false ) bindKey ( player, ".", "down", function () switchIndicatorState('right') end, false ) But nothing work Could you help me on this ? PS: The "," is coma and the "." is dot.