Jump to content

Citizen

Moderators
  • Posts

    1,803
  • Joined

  • Last visited

  • Days Won

    8

Everything posted by Citizen

  1. Citizen

    help pls

    Yeah my bad, sorry. Just change the line 6 to this: local state = states.closed
  2. Citizen

    gui panel

    You did a typo in the first lua tag, you probably wanted to write showCursor(true)
  3. Of course, you didn't even finish your code ... Am I right if I say that you didn't made this code yourself ?? Add this code at the end of "your" code: function ballasmarkerreturntp( hitElement, matchingDimension ) setElementInterior(hitElement, 0, 2230.8000488281, -1408, 23) end addEventHandler( "onMarkerHit", ballasmarkerreturn, ballasmarkerreturntp) function vagosmarkerreturntp( hitElement, matchingDimension ) setElementInterior(hitElement, 0, 1857.0999755859, -2035.8000488281, 12.5) end addEventHandler( "onMarkerHit", vagosmarkerreturn, vagosmarkerreturntp ) function copsmarkerreturntp( hitElement, matchingDimension ) setElementInterior(hitElement, 0, 1554.5, -1675.59998, 15.2) end addEventHandler( "onMarkerHit", copsmarkerreturn, copsmarkerreturntp )
  4. Yeah and set handler to true at line 19 too, otherwise the player would have to enter that command twice to show it.
  5. Can you paste here the path you gave to the search feature ? (I'm pretty sure I'll see a mistake in it)
  6. Well ... no one will script for you or your server for free (except if your server worths it). It's like if you were asking someone on the street to give you 5$ to buy candies.
  7. Citizen

    little question

    thank you, math.ceil works for me. Both would work, but math.ceil will round up the float number and math.floor will round it down: math.floor(5.2) --> 5 math.floor(5.9) --> 5 math.ceil(5.2) --> 6 math.ceil(5.9) --> 6 Regards, Citizen
  8. Could you show us the creation of that interior and a screenshot to really understand your problem ? I guess your interior is transparent because you didn't set the player's interior id but I'm not really sure. Regards, Citizen
  9. Citizen

    help pls

    Sure you can, but you need to use a third state (and not true or false) so we will likely do like this: local states = { closed = 1, moving = 2, opened = 3 } local state = false --variable that will hold the current state of our gates local objeto1 = createObject ( 980, 1460.6999511719, 802.70001220703, 15.199999809265, 0, 0, 0) local objeto11 = createObject ( 980, 1441.4000244141, 802.70001220703, 15.199999809265, 0, 0, 0) function openLTNGate( thePlayer ) --Please use better function names like this one (even if this one is not that accurate) local movingTime = 2000 --time the gates will take to move entirely (in ms) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup("user."..accName, aclGetGroup ( "|LTN|" ) ) then if state == states.closed then --if gates are closed moveObject( objeto1, movingTime, 1460.6999511719, 802.70001220703, 22, 0, 0, 0) moveObject( objeto11, movingTime, 1441.4000244141, 802.70001220703, 22, 0, 0, 0) outputChatBox ( "#00bbff[base LTN] => #0000ffAbriendo #00ff00Entry", thePlayer, 255, 255, 255, true ) state = states.moving --set the current state as moving to prevent someone to close before setTimer(function () state = states.opened end, movingTime, 1) --set as opened after 2secs in our case elseif state == states.opened then --if gates are opened moveObject ( objeto1, movingTime, 1460.6999511719, 802.70001220703, 15.199999809265, 0, 0, 0) moveObject ( objeto11, movingTime, 1441.4000244141, 802.70001220703, 15.199999809265, 0, 0, 0) outputChatBox ( "#00bbff[base LTN] => #0000ffCerrando #00ff00 Entry", thePlayer, 255, 255, 255, true ) state = states.moving --set the current state as moving to prevent someone to open before setTimer(function () state = states.closed end, movingTime, 1) --set as closed after 2secs in our case end end end addCommandHandler ( "ltnentry", openLTNGate ) Please ask if you don't understand a part of this code. Regards, Citizen
  10. Maybe they can't use the marker of these two buildings. But in this case, we need a lot more informations.
  11. i opened all files with Notepad ++ and make a "find in all open files" You should use the "search in folder" feature, and submit the path to the root folder of your MTA DayZ gamemode.
  12. You replaced the texture of the radar border that is from the game files but not the code to render it ! You can't modify the way the gta sa radar is rendered by the game, but you can hide the radar and make your own with dx functions. Hope it will be more clear. Regards, Citizen
  13. Try this, put it anywhere in the server side: function forceCJSkin() setElementModel(source, 0) end addEventHandler("onPlayerSpawn", root, forceCJSkin) Regards, Citizen *Edited*: Fixed the typo (cf. next post)
  14. Ofc, that's what you wrote. by using the createMarker function, it immediately spawn that marker and is visible. You can just hide them and show the randomMarker with setElementVisible but the event onMarkerHit will still be triggered. So you must do the random first and then create the marker. I can see that only the position changes for each marker (except the first marker but I think it wasn't intended), so I would suggest using a table of positions so it will be able to modify easily: local moon2markers = { {692.70, -3341.60, -3.00}, {664.10, -3288.90, 4.80}, {683.90, -3291.00, 5.00}, {701.20, -3260.50, 4.10}, {712.60, -3245.40, 3.70}, {745.20, -3265.70, 4.80}, {759.60, -3230.30, 7.10}, {816.60, -3277.80, 9.20}, {841.00, -3328.90, 17.30} } local reach = nil function moon2 (thePlayer) if reach and isElement(reach) then destroyElement(reach) end setElementPosition(thePlayer, 660.90002441406, -3341.59, 5) outputChatBox("The table contains "..tostring(#moon2markers).." positions, getting a randome one ...", thePlayer) local ran = math.random(#moon2markers) outputChatBox("The random choosed the position number "..ran, thePlayer) reach = createMarker(moon2markers[ran][1], moon2markers[ran][2], moon2markers[ran][3], "cylinder", 0.5, 170, 240, 10) -- addEventHandler("onMarkerHit", reach, myFunctionWhenHitted) end addCommandHandler("moon", moon2) Btw, let me say you that your code is really really dirty, because where dafuq is thePlayer defined ? You said that your script were working and that you are using global variables everywhere, so I guess thePlayer is defined in all other functions that set this variable, and that you are using the same variable in all your script. THAT'S DIRTY ! It will work fine if you are alone on the server, but when there will be more than one player, it will be totally fucked up and will produce unexpected behaviors ... (if you are using this code on the server side though). Regards, Citizen
  15. Citizen

    help pls

    I'm pretty sure he want's a command that says in the chat if the gate is currently opened or closed: function gateStateChecker(thePlayer) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "|LTN|" ) ) then if ( not state ) then outputChatBox("The gate is opened !", thePlayer) else outputChatBox("The gate is closed !", thePlayer) end end end addCommandHandler("checkgate", false, false) Is that what you were looking for ? Regards, Citizen
  16. Wait, does this work ?! The wiki says the event isn't triggered with melee weapons, and 3 is a melee weapon so it shouldn't work . See the note of the wiki page: So use onClientPlayerWeaponFire event instead. But, there is another important note: and you are using the weaponID 3 so according to this list: Weapon ids list it is a melee weapon, so it won't work. So what can we do now ?? We can try to find another event, and I found this event: onClientPlayerDamage and it gives us an important parameter: Great ! We can do it with this event: function Stun( attacker ) outputChatBox("Took damage !") local policeTeam = getTeamFromName("police") if getPlayerTeam(attacker) == policeTeam and getPlayerTeam(source) ~= policeTeam and getElementModel(attacker) == 3 then outputChatbox("Frozen !") setElementFrozen(source, true) end end addEventHandler("onClientPlayerDamage", localPlayer, Stun) Tell me if it works. Regards, Citizen
  17. Hi, Just to let you know that using onClientPreRender instead of onClientRender won't give you "more power to do the action" that event is just called before the second one. Check this link for more information:Game Processing Order I'll check your code later cuz it's kinda big (I'll edit this post if no one post after this one). Regards, Citizen
  18. Both solutions won't produce any crash, so they are both safe. BUT ! I wouldn't recommend the first solution (updating each sec) because it will use resources to update a data in database that's not that important. Since it's just for some stats, it's not needed to update it each sec. I would use the second solution but I would also use a timer to update that data every 10 minutes in case of crash. As far I know, the onPlayerQuit event isn't triggered when the player's game crash (can someone please confirm ?). With this "mixed" solution, it won't spam the database and it will prevent players to loose 10+mins of playing time for their stats in case of crash (server or client). Regards, Citizen
  19. it's "onClientWeaponFire" not "OnClientWeaponFire". Tip: - To debug this problem, you could add an outputChatBox like this: function Stun(attacker) outputChatBox("Fire !") if getPlayerTeam(attacker) == police and getPlayerTeam(source) ~= police and getElementModel(attacker) == 3 setElementFrozen(source) end end addEventHandler("OnClientWeaponFire", getRootElement(), Stun) And you would know the problem wasn't from the team functions but the event. Regards, Citizen
  20. If you can not write in a proper english, do not post in this section. What is wrong asking in your regional forum ??
  21. Citizen

    Group system

    Did you read the example ?? Here is an even more simple example: function kickButton( button ) if button == "left" then --if the player clicked with the left click mouse outputChatBox ( "You clicked the kick button !" ) end end --Creating the button: myButton = guiCreateButton( 0.7, 0.1, 0.2, 0.1, "Kick !", true ) --Adding the click event on myButton to call the kickButton function when clicked: addEventHandler("onClientGUIClick", myButton, kickButton, false) Everything you need is here, I can't do it more simple. Regards, Citizen
  22. Wtf dude, I was waiting for a response, do you understand the english language ? I still don't know what you want to do, so no help can be given ... For me it's like you had say: "Blablablah, I don't understand what you said, just paste the code here and I'll copy it." Hope you will fix your help request (and I said HELP request, not code request) Regards, Citizen
  23. First, I don't understand your latest post. Second, you should ask in your regional forum first. Third, it looks like we (the MTA forum mumbers) are making your whole gamemode/server. Fourth, why using SAUR in your server name ? Try to do your own stuff and learn a minimum please. By following the tutorials on the wiki, you should be able to do that stuff yourself. Regards, Citizen
  24. Citizen

    Group system

    Check the wiki examples: https://wiki.multitheftauto.com/wiki/OnClientGUIClick It does exactly what you want to do. Note: Use a correct title for problems you have. Also, this question didn't require a good scripter as you thought it would. Regards, Citizen
×
×
  • Create New...