
brocky
Members-
Posts
49 -
Joined
-
Last visited
Everything posted by brocky
-
Well, Thanks but can you post the full code exactly with the function you just mentioned? Idk if your english is bad, But I didn't understood you well.
-
The problem with my code is that, I want to switch off the window. The code will explain what I mean. start = getTickCount() addEventHandler("onClientRender", getRootElement(), function() local now = getTickCount() loading = interpolateBetween(0,0,0,532,0,0, (now - start) / (( start + 10000 ) - start ) , "Linear" ) local rectangle = dxDrawRectangle(142, 222, loading, 41, tocolor(23, 23, 231, 255), false) if loading < 532 then givePlayerMoney(1) else givePlayerMoney(0) guiSetVisible(rectangle, false) end end ) I want to disable the dxDrawRectangle but guiSetVisible doesn't works. Whats the fucntion to disable a drawing ?
-
Did you even saw what I just said? I know that every thing is defined in MTA SA Scripting introduction or here, but I have some questions that needs to be simply answered and don't post things that are useless and won't help me, Please and once again sorry for this rude message to you. Anyways. What I just said is Can you explain the upper codes with comments? Because I didn't properly understood it. Q1 = In interpolateBetween function...Why did we subtracted variable "now" from "start", what was the purpose? and why did we divided it? and then added 1000 constant to "start " variable? Q2 = Why did you wrote "Linear" at the end of the interpolateBetween function. Q3 = when we created the second dxDrawRectangle, and at argument three you wrote "with", Why so? what was the reason? Q4 = I checked the MTA scripting introduction about interpolateBetween, but can you explain it little bit and tell me the "actual" purpose of it?
-
I didn't understood anything at all, Please put comments with every code so i can understand it.
-
I really want to make a progress bar in my script and I know the function to make the progress bar, but the problem is that I can't get the progress bar to work!. Can you give me some examples? I want a progress Bar from 1% to 100% and after it is done, then a function will be triggered and it can be anything as you like "setPlayerName", "givePlayerMoney" or anything. But the main thing is that I want a progress bar that works from 1% to 100% and when it is finished to 100% then a function will be called/trigger. Sorry, If you didn't understood what I said.
-
So depending on the code that I posted will this work if i do . triggerClientEvent(player, "jobSpawner", resourceRoot) Depening on my code, Will this code work if I add this line. and if yes Then how will it recognize "player" as the player who triggered the event? Don't we have to define "player" somehow? Can it be defined by the parameter of "onMarkerHit" like the "hitElement" one?
-
what do you mean by this? write = Example the Trigger
-
I have a problem with my code and I am trying to trigger a client event which task is to "Show a GUI", When you enter the marker it will check your team, if it is "PatrolWorkers" then "triggerClientEvent" and if the team is not the one we want, then output the message that "your not in the team". the problem is that everytime the gui doesn't appears and i get the message again and again when I enter the marker "your not in the team". I didn't use the hitElement and matching dimension. Please use THAT too when you show the code spawner = createMarker (268.06826782227, 1361.6530761719, 9.5859375, "cylinder", 5.0, 243, 241, 13 ) function theSpawner() if spawner == source then team = getPlayerTeam(source) if team == "PatrolWorker" then triggerClientEvent("jobSpawner", root) else outputChatBox("You must be a Patrol Worker to use this marker") end end end addEventHandler("onMarkerHit", root, theSpawner)
-
I have a problem with this code, and its that i made a function of button in client side and attached the event to this code which is server sided. and it doesn't takes the player money, and I think the parameters are correct. function buyHouse ( player ) takePlayerMoney ( player, 100000 ) end addEvent("bought", true) addEventHandler("bought", getRootElement(), buyHouse)
-
OMG Thanks, Kariim and everyone else
-
There aro no random words and no "magic" in Lua. And not "perimeters" but parameters. And yes, they are actually arguments you mentioned. So you mean to say they are arguments? I mean like givePlayerMoney(argument1(the player who you want to give the money), argument2(the amount of money). Now I am ok with that but..... How do i know the arguments of function that i made? for example function goingOut() how the heck do i use argument in these? if so how can i add them? what are their uses?, This is my own function not MTA function how can i add arguments from myself? How will they be used and why will they be used? In which kind of scripts are they necessary? I am pretty confused in this part.
-
Magically, the "localPlayer" thing worked and so did Kariim one, but Kariim, I need some more explanation about Perimeters like you used in your code. Please explain Perimeter, It really confuses me, Are they Arguments......Are they just some words added randomly...What are they?
-
Can you explain me a bit more about "permetres" because thats the only thing I don't understand in MTA Lua. @KariiiM
-
I also have problem with this code, I want to set the player who "enters" the marker, Anyone who enters the marker will get to interior 3, but I can't make it and I am forced to specify my own name in this function. out = createMarker ( 418.794921875, -84.074752807617, 1001.8046875, "arrow", 1.5, 236, 229, 30 ) setElementInterior ( out, 3, 418.794921875, -84.074752807617, 1001.8046875 ) function outside() if out == source then setElementInterior( getPlayerFromName("nope") , 0, 209, -63 , 2 ) else end end addEventHandler ( "onMarkerHit", root, outside ) As you can see I am forced to put my name in "setElementInterior" to set my postion, but I want to set the position of the player who enters the marker, but i can't get it and I added my name in "setElementInterior". I need help to set the interior of the player who hit that marker not only me.
-
I made a function to unlock a house and it works perfectly, but it doesn't show the message "House unlocked", What's the problem? function unlockHouse() if button6 == source then guiSetEnabled(button4, true) guiSetEnabled(button5, true) outputChatBox("House Unlocked", source, 246, 8, end end addEventHandler("onClientGUIClick", button6, unlockHouse, false)
-
How do i change it to my player FFS? How do i change it to "When someone clicks the button "only" the clicker will get the weapon" not others. Can you state the argument of giveWeapon
-
Ok thanks, I am gonna try it, Any errors and I will edit this POST
-
Hello, I need help once again with "blocking buttons". Here is the example of the code. local button1 = guiCreateButton(13, 54, 140, 29, "Buy Vehicle", false, window1) local button2 = guiCreateButton(158, 55, 77, 28, "Sell Vehicle", false, window1) Now what I want to know is that, How can i block buttons? example is . If you click "button1" then you can click "button2" else you can't click on "button2" and it will not work unless "button1" was true. More explanation in simple words is that if you click on "Buy Weapon" button, then you can click on "Sell Vehicle" else you can't click on "Sell Vehicle" if you didn't click "Buy Vehicle" which means you don't have any Vehicle to sell, so thats why buton "Sell Vehicle" is blocked and unblock it when "Buy Vehicle" is true. "How can I block Buttons"?
-
Can you give me a brief example? Because I didn't actually got what you said about the root function. I understood that it will give the weapon to all player, but how to prevent that? How so?
-
Can anyone tell me how can i attach this GUI to a marker? I mean when you hit the Marker and the GUI opens. I know about the "onMarkerHit" function but can you show it in detail. here is the code that I want to attach to a GUI. MyGUI = { button = {}, window = {} } addEventHandler("onClientResourceStart", resourceRoot, function() window1 = guiCreateWindow(81, 102, 631, 447, "TheShop", false) guiWindowSetSizable(window1, false) button1 = guiCreateButton(13, 54, 140, 29, "MyGuns", false, window1) end )
-
I was trying to make a weapon shop gui. When you click the button1 it will give you weapon but the problem is i don't get weapon. if button1 == source then x = getPlayerMoney(source) if x >= 60000 then triggerServerEvent("shotgun", root ) giveWeapon( root, 27, 100 ) outputChatBox("You successfully bought a Combat Shotgun") else outputChatBox("You don't have enough cash") end end end addEventHandler( "onClientGUIClick", button1, shotGun, false )