
DarkLink
Members-
Posts
610 -
Joined
-
Last visited
Everything posted by DarkLink
-
Ahhh didnt know i could do that ! I though that was only with separated functions thanks alot bro ;D
-
By the way guys, is there anyway to make a little delay before the player get teleported ? without the setTimer ? because if I use a setTimer I have a code more complex with two functions.. like these: function eventTrigger (player) thePlayer = player setTimer(teleport, 1000, 1) end addEventHandler("onMarkerHit", markerofcol, teleporte) function teleport () local x,y,z = getElementPosition(marker2) setElementPosition(thePlayer, x, y, z) end so there is a better way and with less code to make a delay? thanks!
-
LOOOL GUYS, i forgot to replace the name in .map file --« I AM THE BIIGGEST LOSER LULZ Thanks alot UAE ;D
-
Guys I need ur help, i made these like someone said me a few days ago using getElementByID, but is not working. 1º I have one resource called "olamundo" in that resource (i mean, in that folder), i have .map file and meta.xml file and .lua file. i have this one .map file: <map edf:definitions="ctf,editor_main"> <marker id="marker (cylinder) (1)" type="cylinder" color="#0000ff99" size="2" interior="0" dimension="0" posX="770.58630371094" posY="1668.0819091797" posZ="4.1890187263489" rotX="0" rotY="0" rotZ="0" /> <marker id="marker (cylinder) (2)" type="cylinder" color="#0000ff99" size="1" interior="0" dimension="0" posX="796.76818847656" posY="1668.2836914063" posZ="6.8681697845459" rotX="0" rotY="0" rotZ="0" /> </map> these on meta: <meta> <info author="dont want u to read :b" version="0.1" type="gamemode" name="DarkLink" description="testing" /> <script src="Untitled 3.lua" type="server" /> <map src="teleporte.map" dimension="0" /> </meta> and on .lua file: markerofcol = getElementByID("marker1") q,w,e = getElementPosition(markerofcol) marker2 = getElementByID("marker2") function teleporte (player) local x,y,z = getElementPosition(marker2) setElementPosition(player, x, y, z) end addEventHandler("onMarkerHit", markerofcol, teleporte) And I have these errors on console when I run the resource olamundo: First Error: bad argument at 'getElementPosition' Second Error: bad argument at 'addEventHandler' So can u guys explain me what I am doing wrong? thanks alot again
-
thanks alot bro, i will test tonight . cya
-
and no one is thinking of made on ? :b
-
I want to put lights always off when entering a vehicle that has the engine off.. was working before, but not anymore function setLights () if ( (getVehicleEngineState ( source ) ) == false ) then setVehicleOverrideLights ( source, 1 ) end end addEventHandler("onVehicleEnter", getRootElement(), setLights) I hope u guys can help thanks anyway EDIT: FIXED, Changed from onVehicleEnter to onVehicleStartEnter and it works now . Thanks anyway. u can close.
-
Made my day rofl Dont be so mad , he could not know ..
-
AHAHAHAHHA I MADE IT!! THIS IS AWESOME scripting is so amazing +.+ Look the solution: function callTheFunction() theVehicleBrokenLights = source setTimer(vehicleBrokenLightsTurnOffBlip, 1000,1) end addEventHandler ( "onVehicleDamage", getRootElement(), callTheFunction ) function vehicleBrokenLightsTurnOffBlip() if getVehicleLightState(theVehicleBrokenLights,0) == 1 and getVehicleLightState(theVehicleBrokenLights,1 ) == 1 then destroyElement(blip) --make sure that blip defined end end Thanks alot guys ;D
-
yes but when do I put the timer function? I already had read the documentation on wiki, but dont know where to put it.. because of the handler.. should it be : function luzesPartidasDesligarBlip() if getVehicleLightState(source,0)==1 and getVehicleLightState(source,1 )==1 then destroyElement(blip) --make sure that blip defined end end addEventHandler ( "onVehicleDamage", getRootElement(), setTimer(luzesPartidasDesligarBlip,100,1) )
-
which one? its BrokenLightsTurnOffBlip, if u want in english. and the function its created, its that one u have in Lua code. then the handler call it.
-
ahn? thats the same i post on the start of topic bro u just change the name of the function .. and its not correct, two names different ? i dont understand. but thanks bro!! dont know where to use the setTimer
-
but where do i put the setTimer ? when i call the function in recursion? or.. thanks! edit: do u mean this? function luzesPartidasDesligarBlip() if ((setTimer(getVehicleLightState(source,0),100,1)==1) and (setTimer(getVehicleLightState(source,1 ),100,1)==1)) then if (isElement ( blip )) then destroyElement(blip) --make sure that blip defined end end end addEventHandler ( "onVehicleDamage", getRootElement(), luzesPartidasDesligarBlip )
-
tryed this in recursion , calling the function inside the function function luzesPartidasDesligarBlip() if (not isElement (blip)) then return end if ((getVehicleLightState(source,0)==1) and (getVehicleLightState(source,1 )==1)) then if (isElement ( blip )) then destroyElement(blip) --make sure that blip defined end end return luzesPartidasDesligarBlip() end addEventHandler ( "onVehicleDamage", getRootElement(), luzesPartidasDesligarBlip ) [EDIT: On console I notice that with this recursion mode, the function enters in a infinite loop. Soo we can conclude that, when "onVehicleDamage" brokes a light , that broken light dont get updated for the function, so.. infinite loop. ] but still doesnt work, the blip goes off on the next hit. not on the hit that brokes the last front light turned on. it seems that when I call that function using onVehicleDamage , that damage that broken the last lamp, doesnt count.. why ???? can someone help me here? I would really appreciate! Thanks in advance!
-
is there some plugin for mat editor that does that ? thanks
-
karlis thanks for ur answer ! I already tryed that before, but there is the problem with that trigger.. blips is just turned off on the next onVehicleDamage . dont know if u understand, look this example: 1. u hit house (left light broken) 2. u hit house (right light broken) (blip should be turned off now, but keeps on) 3. on the next hit , the blip is turned off. u see ? i want to turn off on the second point, just when the hit brokes the last light turned on. i hope u understand, thanks! EDIT: I think the solution is calling the same function inside that function, but dont know how to do it in LUA.. add another handler inside function? thanks.
-
Guys I made this code to turn off the blip attached to vehicle when that vehicle get both front lights broken, but it doesnt work. can someone help me? function luzesPartidasDesligarBlip (thePlayerOrVehicle, matchingDimension) if ( (getVehicleLightState ( thePlayerOrVehicle, 0 ) == 1) and (getVehicleLightState ( thePlayerOrVehicle, 1 ) == 1) ) then destroyElement (blip) end end addEventHandler ( "onColShapeLeave", getRootElement(), luzesPartidasDesligarBlip ) Edit: the blip is defined in another function
-
My question is: Does map editor can define how much vehicles is possible to put according to the gamemode? Example: On my gamemode named "X" i want to be only possible 4 cars ! so map editor user can only put 4 cars on that map of gamemode X. did u guys understand? If map editor user try to put the 5th car map editor says: "gamemode doesnt permit more than 4 cars". Is it possible? thanks
-
I already managed to open ports!!! 22003 UDP is open, 22126 is open and 22005 is also open ! Now I go to http://www.ip-adress.com/ and try to connect at quick connect using that IP, and it keeps saying timed out! why?? Do i have to activate DMZ mode of router on the device of my server?? Thanks!
-
Come on guys, u are off-toping too :b (and me also) But Jay is a nice guy, dont say that Thanks both
-
Thanks dude, but I already desactivated windows firewall and also dont work, i dont need to add it those tcp/udp ports on firewall advanced settings. cos i am tryind with windows firewall off.. so
-
Guys is there some problem hosting a server on a laptop (wireless) connected to router via wireless? I opened ports in my router.. all of them, UDP 22003, UDP 22126 and TCP 22005 and on the server console when i use 'openports' , it always says that ports are closed.. Is there some incompatibility with windows seven and server.. or? thanks in advance
-
okay thanks alot dude bb
-
Thanks SDK, so that is the function they use for assault gamemode ? People place objective on map editor (costum element), and then the script use that function to receive it. right?
-
Hi guys, i have one question. Is it possible to get those elements created in map files (map editor) to .lua script ? My script need to get those elements.. so i dont need to change the .lua for every map, and people can make many maps for my gamemode.. But how to get elements from .map files and manage them in .lua scripts ? thanks.