Jump to content

DarkLink

Members
  • Posts

    610
  • Joined

  • Last visited

Everything posted by DarkLink

  1. I notice that although the createObject call is before the call of isLineOfSightClear, the objects gets created after the check of the line.. and it says that there is no object, when acctually there should be, because I created before than the check of the line.. but seems that createObject is not instantly it takes some time.. I guess there is no workaround to this ? Someone more experienced maybe know how to.. thanks in advance
  2. 1º What I want is a event that will be executed always so : "onClientRender" why this event? because: I wanna check a piece of wood if is on destroyed state or not (destroyed state is checked by isLineOfSightClear, if it returns true, its destroyed) 2º when its on destroyed state, just destroy wood and create it again. Do u guys understand? thanks alot in advance
  3. Hi there guys, I could make this with event on client shoots the weapon. but the object can be destroyed by others things.. I need to use the "onClientRender" to always check if is destroyed and to respawn, but I have something bad on my code, cant find it Can someone help me? Here is the code: function createWood() local xW,yW,zW = getElementPosition(wood) local xWR, yWR, zWR = getElementRotation(wood) destroyElement (wood) wood = createObject ( 1418, xW, yW, zW, xWR,yWR,zWR, false ) end function createLine() dxDrawLine3D (xW, yW, zW+1, xW, yW, zW-1, tocolor ( 0, 255, 0, 255 ), 10) -- this is only to help me, to know which line would isLineOfSightClear would use local result = isLineOfSightClear ( xW, yW, zW+1, xW, yW, zW-1) outputChatBox("o resultado e: " .. tostring(result)) if(result) then outputChatBox("no obstacle visible") removeEventHandler("onClientRender", getRootElement(), createLine) setTimer(function() createWood() outputChatBox("vai activar") addEventHandler("onClientRender", getRootElement(), createLine) end, 1000, 1) else outputChatBox("obstacle visible") end end function place() local x,y,z = getElementPosition(source) wood = createObject ( 1418, x + 3, y, z+3, 150.23657226563, 50.000610351563, 150.47875976563, false ) xW,yW,zW = getElementPosition(wood) xWR, yWR, zWR = getElementRotation(wood) outputChatBox("a wood vale:" .. tostring(wood)) addEventHandler("onClientRender", wood, createLine) end addEventHandler ( "onClientPlayerSpawn", getRootElement(), place ) Thanks alot in advance
  4. Hi there guys, its been a while since the last update on this gamemode I must say that school was good, I made everything, and I have now one week to work on this . because second semester it will start soon ! I am very rusty, but today I start scripting a bit and have a few updates for you guys: I must say that its almost done for a beta, but I need to polish a few things, dont wanna a bad beta Thanks all your support people and especially MTA
  5. Problem solved guys, I notice that, the timers on client render its kinda problematic, I made it another way. Thanks alot castillo
  6. Okay mate the thing I am trying to do is rebuild a object that goes into destroyed state after gets shooted, u see? I could do it without any timer, it gets immeadiatly rebuild after gets shooted, but I want with some delay.. so I tryed this code: local on = false local xW,yW,zW = nil,nil,nil local xWR,yWR,zWR = nil,nil,nil local wood = nil function createLine() xW,yW,zW = getElementPosition(wood) xWR, yWR, zWR = getElementRotation(wood) dxDrawLine3D (xW, yW, zW+1, xW, yW, zW-1, tocolor ( 0, 255, 0, 255 ), 10) -- this is only to help me, to know which line would isLineOfSightClear would use if(isLineOfSightClear ( xW, yW, zW+1, xW, yW, zW-1) and getElementData(wood,"nr", false) == 0) then outputChatBox("no obstacle visible") setElementData(wood,"nr", 1) setTimer(function(xW,yW,zW,xWR,yWR,zWR, wood) destroyElement (wood) wood = createObject ( 1418, xW, yW, zW, xWR,yWR,zWR, false ) setElementData(wood, "nr",0) end, 1000, 1, xW,yW,zW,xWR,yWR,zWR, wood) else outputChatBox("obstacle visible") end end addCommandHandler ("line", function () if(on) then on = false removeEventHandler("onClientRender", getRootElement(), createLine) else local x,y,z = getElementPosition(getLocalPlayer()) wood = createObject ( 1418, x + 3, y, z+3, 150.23657226563, 50.000610351563, 150.47875976563, false ) setElementData(wood, "nr", 0) addEventHandler("onClientRender", getRootElement(), createLine) on = true end end ) and the element data on the wood is because I need a mechanism to wait to get the piece rebuild before send any setTimer, u see? if I dont use this.. many setTimers will be called because the the line will be clear.. and onClientRender will call that function many times.. u see? I guess u understand now Hope u can find the problem, because the code seems fine to me Thanks alot in advance mate!!!
  7. Something like, since the setTimer is inside the function that "onClientRender" calls it should not work?? function example() outputChatBox("wtf3") xW,yW,zW = getElementPosition(wood) xWR, yWR, zWR = getElementRotation(wood) if(expression == true) then outputChatBox("wtf4") destroyElement (wood) setTimer(function(xW,yW,zW,xWR,yWR,zWR) wood = createObject ( 1418, xW, yW, zW, xWR,yWR,zWR, false ) end, 5000, 1, xW,yW,zW,xWR,yWR,zWR) else outputChatBox("nothing") end end addCommandHandler ("line", function () addEventHandler("onClientRender", getRootElement(), example) end ) The problem is that I never see outputChatBox saying nothing or wtf4, and I know that expression goes true sometimes.. Do you know ? thanks in advance mate
  8. cant a setTimer be inside a function that is attached to the onClientRender event? it wont call many timers, because its inside an if condition.. and it enters there only some times.. I remember that I cant have timers on onClientRender events But there must be a solution..
  9. Okay guys, I always had problems with setTimers, if someone can give me a good explanation to this.. I would be very appreciated! I am trying to do something like : but its not working setTimer(function() wood = createObject ( 1418, xW, yW, zW, xWR,yWR,zWR, false ) end, 5000,1) also tryed this way: setTimer(function(xW,yW,zW,xWR,yWR,zWR) wood = createObject ( 1418, xW, yW, zW, xWR,yWR,zWR, false ) end, 5000,1, xW,yW,zW,xWR,yWR,zWR) I dont know when I need to pass arguments on timer and when I dont need it Thanks alot in advance!!!
  10. Ahn right, ofc! I am very rusty, since the 2011 :c Need to work a bit to recover the time lost
  11. Is there any problem using outputchatBox to print bool vars ? I guess I cant.. I have this, and I only see the "hei" on chatbox not the "bee false" local ca = false outputChatBox("hei") outputChatBox("bee " .. ca) Why the hell? oO Thanks in advance!
  12. I guess Lua its a bit baah compared to java Try this : if ( (vehicle == false or getVehicleOccupant(vehicle, 0) ~= localPlayer) ) then result = true else returl = false end I guess it works !
  13. instead of attaching the event to all the root attach to only local player like this: from this: addEventHandler("getTextClient",getRootElement(),getthesite) to this: addEventHandler("getTextClient",getLocalPlayer(),getthesite) i hope it fixes, gl
  14. Acttualy I am, I dont really know what is the name of the file of the police ranger, do u know? Anyway the images show are kinda weird, I though I could change the colors on .txd of some details and such.. Thanks
  15. Thanks for your fast reply solidsnake I already had a look at that before posting in here, and I found ranger.txd on gta3.img... but there are strange imgs.. nothing saying police that I can edit.. So ? I dont get it mate, thanks in advance
  16. Okay look, I never had modding for gta, but I already replace some years ago.. I know that there are .dff and .txt files right? Now my question is, there is a car named "ranger", its the police rancher you know? On that car there are words like: POLICE.. or something else.. right? So which is the file responsible for that? its the texture file right? .dff its only for object 3d model I guess.. If so.. how do I change a texture? which program? where can I open the texture saying "police" and name it ? Not blender or autodesk, thats for object body 3d right? Maybe I am wrong, wanna answers of someone that knows . Thanks in advace
  17. I dont like ur attitude ! Be a gentleman, dont be rude mate! @Topic Starter I dont know u either, but I know ur feeling, things had changed alot.. and they are on a good road ! So ye, glad you are back, welcome back ;D
  18. This is what I was saying on page 1, but maybe he have features that xfire doesnt have.. but I dont think so Anyway like I said before, good effort !
  19. Okay guys this might sound bad, but I dont really know what too look for when searching hosts for MTA Does it need php? ftp acess? .. I see many details on internet at each host.. My question is: what I need for hosting a MTA Server 32 slots ? linux or windows btw? Thanks in advance
  20. Great work mate, just have two question, this is for in-game use right? And if its not the same as xfire ? just asking, good work mate
  21. Thanks alot mate, still good people here on forum helping like I though Amazing !
  22. DarkLink

    Resource Not Found

    Never mind ! it wasnt a zip, it was a rar ! changed to zip and its fine now
  23. DarkLink

    Resource Not Found

    Hey there guys, I have been away and now I am back tryng to get back to the road.. Soo.. I notice that mta 1.2 changed how resources are loaded to the server right? I had a resource folder on server resources folder, and now on 1.2 I cant load it, why? I set on mtaconfig to start at server start, but then console says that doesnt found that resource.. can someone help me? here is my directory : ..MTA San Andreas 1.2\server\mods\deathmatch\resources\[gamemodes]\[borderpatrol] and inside that I have a zip with borderpatrol files soo.. what is wrong? thanks!
×
×
  • Create New...