Jump to content

DarkLink

Members
  • Posts

    610
  • Joined

  • Last visited

Everything posted by DarkLink

  1. exactly but thats what I want. the passenger to be out of vehicle, then go to prison.
  2. Thanks bro, I figure that today.. I was trying to teleport players that were in cars, but didnt was working.. and removing them from vehicles first solved the problem.. but now I have another kinds of problems, like those one I posted above.. do u know something about it ? Thanks
  3. This is not the first time I get errors like these, and dont know how to fix them. Its about local variables.. that are not made, I guess.. look this code: local entrada = getElementByID("entrada2") local prisao = getElementByID("prisao") local x,y,z = getElementPosition(prisao) function enviarParaPrisao(hitElement) if (getElementType(hitElement) == "vehicle") then local deliver = getVehicleOccupant(hitElement,1) --bad deliver? setTimer(teleporte, 2000,1, deliver, hitElement) end end addEventHandler("onMarkerHit", entrada, enviarParaPrisao ) function teleporte (deliver, hitElement) if(isElementWithinMarker(hitElement, entrada)) then removePedFromVehicle(deliver) setElementInterior ( deliver, 6) setTimer(setElementPosition, 1000, 1, deliver, x, y, z + 1) toggleControl ( deliver, "enter_exit", true) else outputChatBox("car not in marker") end end I keep getting errors on console, but function does what I want.. but I have this errors: bad argument @ 'removePedFromVehicle' bad argument @ 'setElementInterior' bad argument @ 'toggleControl' I hope u guys teach me this, commun errors.. Function does what is suppose to do, but always have errors like that on console! WHY? Thanks guys, I hope u know what is the problem.
  4. Hey guys, I keep getting this error on console and dont know why can u guys please help me? I have this code: function teleportar1(hitElement) if (getElementType(hitElement) == "player") then setTimer(setElementPosition, 1000,1, hitElement, x2,y2,z2) else outputChatBox("hei") local player = getVehicleController(hitElement) setTimer(setElementPosition, 1000, 1, player, x2,y2,z2) end end addEventHandler("onMarkerHit", passagem1, teleportar1 ) I am hitting the marker with a bike.. and I am on the bike. and I get the "hei" on outputChatBox. THANKS! EDIT: fixed
  5. I am using setElementInterior, using ID 3 of interior, and then the coords inside the cell .. but no floor and keeps falling But if I teleport to a coord outside of the cell works.. how can this be fixed ?
  6. Okay guys, I am trying to teleport a player to a building (LVPD HQ in my case) but when my players gets teleported, I see the building but cant see the floor.. and then the players starts fallin.. like no end How can this be fixed?? THANKS! EDIT: its seems that I have this problem inside the cell of LVPD HQ, when I teleported to inside the cell.. the players falls, its like there is no floor on the cell.. I tryed to put there some object to simulate a floor.. but still falls.. WHY ? :C does someone knows what can I do ?
  7. I tryed like u said, but is not working bro I did this: setControlState ( k, "enter_exit", false) EDIT: with toggleControl is working, any problem using this one? on wiki, says that is somekind of problem ? This article needs checking for the following reason: By enabling a control all bindings belonging to it seem to be deleted. (tested clientside) --NeonBlack 16:48, 28 August 2009 (UTC)
  8. thanks alot, its exactly what I was looking for ;D ty
  9. Hey there guys, I am having some problem here.. I want to set a player locked in a vehicle, so he cant exit. Which function should I use to do that? Is there any option beside.. onExitVehicle, then cancelEvent ? Thanks!
  10. Guys can u help me? I have been testing, and this is not the best solution.. Becouse some times the source ( player that got hitted) goes to ground, but he's task is not TASK_SIMPLE_FALL , that was suppose to be.. I tested it with outputchatbox.. Any better solution? TY
  11. I made it u can close it. btw solution: task = getPedSimplestTask ( source ) if (task == "TASK_SIMPLE_FALL") then --do wtv u want here.. end
  12. for damage there are not reasons, cant use then
  13. Thanks for ur help, but its not that what I am looking for. Its when its damaged, not when its dead . And I wanna know if he falls to the ground when its damaged. Ty
  14. Okay guys, I guess that was already been posted something about this.. I searched but didnt find the post So at the event onPlayerDamage I want to know if the source ( the player that got damage ) hitted the ground.. Let me get it clear: When player gets punched sometimes he falls on the ground. I wanna know if there is some function that does that. isPlayerOnGround is not for this, I already notice on wiki. My friend told me, to use getGroundPosition and then get Z position of the player and if its less than a certain amount (that I need to test) he (the player that got punched) is on ground.. But here comes alot of problems: 1º this function is client side, and will mess my things.. 2º Me and my friend are not 100% sure if Z position of a player changes between his states (up, crounch, down on floor).. Thanks guys, would appreciate some help here
  15. onResourceStart is triggered only once onClientResourceStart is triggered every time a player downloads the resource clientside file (but only once per client unlill disconect, it will be triggered again after reconnect ) so if you want to replace the startup code "onResourceStart" and run it with a custom event triggered by "onClientResourceStart" it will be like starting a new resource every time a player join the server (you will eventually run out of memory, and same stuff will be run multiple times) but "onClientResourceStart" may be used for detecting if it's safe to trigger client events to a specyfic client Okay , didnt know that will be trigger like infinite times (each client start resource) Solved some of my problems now Thanks alot wojak
  16. yeye u were right ofc. I wasnt doubting thanks mate
  17. wtf?! How did u find that ? I looked here: https://wiki.multitheftauto.com/wiki/Ser ... _functions and didnt find lol TY! EDIT: Lol nevermind, I am so dumb :facepalm: Its on elements section x) Thanks alot bro
  18. Because I dont have something like isElementWithinMarker for colshapes colshapes just have on hit and on leave ty for ur reply
  19. Okay guys, I noticed today that when we make a bigger marker (well lets say 100 size, I tested it), it gets out of sync...? Example given: the event "onMarkerHit" is only triggered when the player reachs about the middle of the marker .. and not on its border, like is supposed to .. any solution for this? Hope u guys understand. Thanks!
  20. Thanks alot guys, I understood the problem And the solution too ! I will use now onClientResourceStart instead of onResourceStart TY!
  21. AHAHAH LOL! The server makes things to fast, then it doesnt receive some things.. But with timer it works!! Really amazing solution Thanks alot mate!
  22. hmm I see , so its a MTA problem? cant be fixed ? thanks for ur reply
  23. Okay guys, I am having here a major bug that I really need to fixed it. But cant .. So I am having these error on clientscript: [2011-06-25 18:37:43] ERROR: Server triggered clientside event showDX, but event is not added clientside And its everything okay to me, add event true.. the handler is okay too.. CLIENT SIDE: addEvent ( "showDX", true ) function showNumbersDX () addEventHandler ( "onClientRender", getRootElement(), drawDX ) end addEventHandler ( "showDX", getRootElement(), showNumbersDX ) addEvent ( "hideDX", true ) function hideNumbersDX () removeEventHandler ( "onClientRender", getRootElement(), drawDX) end addEventHandler ( "hideDX", getRootElement(), hideNumbersDX ) function drawDX () X,Y = guiGetScreenSize () X = X * (2.5/3) Y = Y * (1/4) dxDrawText ( getElementData(getLocalPlayer(),"secondsRemaining"), X, Y, X, Y, tocolor(255, 255, 255, 255), 5) end SERVER SIDE: segundos = 30 timerEnabled = false function onJoin () if gamemodeStarted == false then setElementData(source,"secondsRemaining",tostring(segundos)) --if timerEnabled then --setElementData(source,"secondsRemaining",tostring(segundos)) --triggerClientEvent ( source, "showDX", source) --end if(getPlayerCount() >= 2) then escreve() end end end addEventHandler ( "onPlayerJoin", getRootElement(), onJoin ) function escreve () timerEnabled = true for i,v in pairs(getElementsByType("player")) do setElementData(v,"secondsRemaining",tostring(segundos)) triggerClientEvent ( v, "showDX", v ) end setTimer(countDown,1000,30) end function countDown() segundos = segundos -1 for i,v in pairs(getElementsByType("player")) do setElementData(v,"secondsRemaining",tostring(segundos)) end if segundos <= 0 then triggerClientEvent ( "hideDX", getRootElement() ) timerEnabled = false spawn() gamemodeStarted = true end end function onStart () timerEnabled = false if(getPlayerCount() >= 2) then --for i, v in ipairs(getElementsByType("player")) do --setElementData(v,"secondsRemaining",tostring(segundos)) --end escreve() end end addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), onStart ) I think was Solid Snake that helped me doing this timer with DxDrawText (thanks btw) Now I changed somethings to do this: when resource stops, and then start again.. if there are more than 2 players the timer will start again.. and ofc the gamemode too. But when I try to do that. 2 players on server. I STOP resource. I START resource. then the timer dont appear.. and I get that error on clientscript. I guess its weird And I dont know how to fix it. I hope u guys know the problem, thanks alot!
  24. I understood, thanks alot bro. Thats exactly what I was trying to do, didnt know rows was a int starting from zero to number of rows.. Now I can make a for and search all the rows, just with a iteration for Didnt know ^^ thanks alot again !
  25. yes I understand that, so not possible to edit a single row.. when its the grid is filled with rows? right? thanks again
×
×
  • Create New...