Jump to content

Hell-Mate

Members
  • Posts

    198
  • Joined

  • Last visited

Everything posted by Hell-Mate

  1. Hell-Mate

    Problem.

    its okay, i will try to translate it, but what event should i add ?
  2. Hell-Mate

    Problem.

    Citizen thanks. but can you please write an example in lua ? i just got it 50%, can u write it in lua and real functions to get it 100% ?. thanks , btw dont forget to add the event . thanks very much
  3. Hell-Mate

    Problem.

    Citizen, as i said i want it not from 1 hit, the ex you wrote will do my stuff from only 1 hit by nightstick i want it do my stuff from 2 or more hits by nightstick not only one. thanks
  4. Thanks. i forget to add num to the trigger , thanks whoami
  5. hmmm, anyone can help please ??
  6. hello community i have problem in this code .. i will not post the whole script. --client GUIEditor.edit[1] = guiCreateEdit(116, 286, 149, 28, "", false, GUIEditor.window[1]) GUIEditor.button[1] = guiCreateButton(276, 278, 95, 46, "Buy wine", false, GUIEditor.window[1]) addEventHandler ( "onClientGUIClick", GUIEditor.button[1], function ( ) num = tonumber ( guiGetText ( GUIEditor.edit[1] ) ) if not num then return outputChatBox ( "Invalid number.", 255,0,0 ) elseif num > 50000 then return outputChatBox ( "Maximum time is 50000 (50 secs)", 255,0,0 ) end triggerServerEvent ( "onbuywine", localPlayer ) end) --server function drunk ( num ) setTimer ( removeElementData, num, 1, source, "drunk" ) setTimer ( setPedWalkingStyle, num, 1, source, 0 ) outputChatBox ( "Press alt to walk on drunk mode, you have " .. num .. " mili-seconds to be normal!",source,255,0,255, false ) end addEvent( "onbuywine", true ) addEventHandler( "onbuywine", root, drunk ) Errors/Warnings when pressing button : argument 2 ( got nil ) line 1 and 2 and attemp to concatenate a 'local' num ( a nil value ) some one help please
  7. Hell-Mate

    help :(

    use onPlayerTarget instead of onClientResourceStart ..
  8. Hell-Mate

    Problem.

    well i checked ur link and downloaded the script but understood nothing .. where is the part that checking how many hits done to the source or theprisoner ? function rodneykingcheck ( attacker, weapon, bodypart, loss ) if (attacker) and (weapon == 3) then if getElementParent(attacker) == kingCOP then local thecop = attacker local theprisoner = source local wlevel = getPlayerWantedLevel( source ) if (getElementData ( theprisoner, "currentstatus" ) ~= "underarrest") and (wlevel > 0) then if (getElementData ( attacker, "currentarrests" ) ~= "single" ) and (getElementData ( attacker, "currentarrests" ) ~= "double" ) then setElementData ( thecop, "currentarrests", "single" ) triggerClientEvent(thecop,"copdirections",thecop) elseif (getElementData ( attacker, "currentarrests" ) == "single" ) then setElementData ( thecop, "currentarrests", "double" ) end setElementData ( theprisoner, "currentstatus", "underarrest" ) setElementData ( theprisoner, "captor", thecop ) showCursor ( source, true ) toggleAllControls ( source, false, true, false ) walktheprisoner ( thecop, theprisoner ) setElementData ( theprisoner, "arrestTimeout", setTimer ( freetheguy, 180000, 1, theprisoner )) end end end end addEventHandler ( "onPlayerDamage", getRootElement(), rodneykingcheck ) i want anyone help me with a simple example not a whole script .. Thanks btw thanks xxmadexx for you effort.
  9. Hell-Mate

    Problem.

    Hello community ,, i have a problem. i'm making a police job script, my problem is the police when arresting someone.. i made the event onPlayerDamage. the proble is that i want it not getting warped to the jail from only on hit from the nightstick i want it from 3 or 4 or whatever hits .. should i change the event ? should i change somethings in the function ? i hope someone can help. thanks
  10. Citizen, done. thanks very much.
  11. example script ? to get it ..
  12. my ques is how to get how much it changed
  13. Hello community ,, is there any function to getPlayerTakenMoney and getPlayerGivenMoney ? because i want to draw a dxText when a place added to him money or taken from him money.
  14. Hell-Mate

    Question !

    Hello community ,, is there is a function like createMarkerAttachedTo ? to create a marker attached to an element or player ?
  15. Try this. GUIEditor = { window = {}, memo = {}, button = {} } addEventHandler( "onClientResourceStart", resourceRoot, function () -- Create our button GUIEditor.window[1] = guiCreateWindow(166, 127, 540, 359, "Rules", false) GUIEditor.button[1] = guiCreateButton(311, 254, 162, 19, "Rules", false, GUIEditor.window[1]) guiWindowSetSizable(GUIEditor.window[1], true) GUIEditor.memo[1] = guiCreateMemo(9, 22, 521, 327, "/n button not working", false, GUIEditor.window[1]) guiSetVisible(GUIEditor.memo[1],false) guiMemoSetReadOnly(GUIEditor.memo[1], true) showCursor (true) function hmm () if guiGetVisible (GUIEditor.memo[1]) == true then guiSetVisible (GUIEditor.memo[1],false) else guiSetVisible(GUIEditor.memo[1],true) end end end) addEventHandler ( "onClientGUIClick", GUIEditor.button[1], hmm, false ) not tested but as i see it should work.
  16. user getElementRotation and setElementRotation rX, rY, rZ = getElementRotation ( gate ) setElementRotation ( gate, rX, rY,rZ, true ) well for example if you want to rotate from Z then it will look like this setElementRotation ( gate, 0, 0, rZ+50, true ) + 50 is the amount of rotation.
  17. user getElementRotation and setElementRotation rX, rY, rZ = getElementRotation ( gate ) setElementRotation ( gate, rX, rY,rZ, true ) well for example if you want to rotate from Z then it will look like this setElementRotation ( gate, 0, 0, rZ+50, true ) + 50 is the amount of rotation.
  18. Worked. addEventHandler( "onClientRender", root, function( ) local hit = getElementsByType("player") if (#hit > 0) then local x,y,z = getElementPosition(localPlayer) for k,player in ipairs(hit) do if ( player ~= localPlayer ) and (getElementData(player, "hitBlip")) then local pX,pY,pZ = getElementPosition(player) --ped's position local tX,tY,tZ = pX,pY,pZ+1 --text's position local maxDistance = 30 local distance = getDistanceBetweenPoints3D(x, y, z, tX, tY, tZ) local Amount = getElementData ( player, "Amount" ) if (distance <= maxDistance) then local wX, wY = getScreenFromWorldPosition(tX, tY, tZ) if (wX and wY) then dxDrawText("Kill for ($" .. Amount .. ")", wX + 2, wY + 2, _, _, tocolor(0, 0, 0, 200), 1.5, "arial", "center", "center") dxDrawText("Kill for ($" .. Amount .. ")", wX, wY, _, _, tocolor(255, 255, 255, 200), 1.5, "arial", "center", "center") end end end end end end ) Thanks
  19. Yup totally, but in the end, he will finally use my code and add the parameters on the ondie function ( totalAmmo and theKiller ) we (initially Solstice. and then I) told him to get who killed the guy who used /hitme. Your code really helped me and now i made it 100% and added a new ElementData to the amount to store every Amount when player do /hitme amount and i took with your advice and opened wiki and learned ElementData fanction --Finally i want to say thanks bro
  20. Hello community ,, i want to create a dxDrawText to be shown to all players except the one who is the text on his head ( ElementData or what ever ) i have created it but its shown to the player that the Text on his head so its annoying, i want it for all players except the players which the text on his head. and here is my script -->> addEventHandler( "onClientRender", root, function( ) local hit = getElementsByType("player") if (#hit > 0) then local x,y,z = getElementPosition(localPlayer) for k,player in ipairs(hit) do if (getElementData(player, "whatever")) then local pX,pY,pZ = getElementPosition(player) --ped's position local tX,tY,tZ = pX,pY,pZ+1 --text's position local maxDistance = 30 local distance = getDistanceBetweenPoints3D(x, y, z, tX, tY, tZ) if (distance <= maxDistance) then local wX, wY = getScreenFromWorldPosition(tX, tY, tZ) if (wX and wY) then dxDrawText("what ever", wX + 2, wY + 2, _, _, tocolor(0, 0, 0, 200), 1.5, "arial", "center", "center") dxDrawText("what ever", wX, wY, _, _, tocolor(255, 255, 255, 200), 1.5, "arial", "center", "center") end end end end end end )
  21. 4 - Kept my calm and just replied your code was nasty and that I just fixed it. 5 - Instead saying thanks for that you wrote like if my code was 100% useless: 6 - Told you that you were forgetting were your place should be (listening to experienced members advices and learn from them, not to kick them out just because it wasn't the answer you were expecting). 7 - You did some kind of apologies 8 - At this point I forgave you and help you with your initial problem and pointed out another problem we both didn't see at the begining, the moneyAmount couldn't be known in the ondie function and told you how to get it (without a global, because you were already using a global with the blip but doing it with a global will just not work if two players use it. That's why I used an element data.) 9 - You just replied sayin you basicaly won't use an element data and just remove the local keyword (to make it global). So here you want to introduce again the same bug from the blip, but for the moneyAmount. I spent (notes here I didn't use wasted, because I never waste my time if it can make others better) time to help you out and fix the problem with the blip by using an element data instead. I also commented everything I changed and why I used element data. By not reading my comments, not listening to my advices and by doing it your way, it's exactly the same as if you said it explicitly. (Oh yeah and you also created another topic to ask the community how to fix the problem with your blip that I already fixed using element datas) And after all of that you dare tell me to "try to talk a better way or stfu" and I also guess in that post that you did nothing wrong and that it's all my fault ?! Ok then, it's all my fault, you are right. I'll just stfu because everything I said untill now was just useless, lies and wrong at the same time. (All the things you need to actually make this script work without bug are in the posts above) Bye. Well, i have no time to read this but anyway im sorry if i hurt your feeling but i really dont mean to.
×
×
  • Create New...