Jump to content

Tony Brand

Members
  • Posts

    46
  • Joined

  • Last visited

Everything posted by Tony Brand

  1. MTA Sa has many Persian Players and many Persian Devs that they want to help this community to grow better and better. we want to see Persian Section in Forum too @qaisjp
  2. the best MTA Has been destroyed....
  3. it is great bro but can you add some examples too?
  4. my save system now saves it OnPlayerQuit and OnPlayerWasted, do you think if i add a 5minute timer for all players and keep OnPlayerQuit ,will fully support save progress?
  5. Hi, i use mysql for save my players datas such as PlayerName,PlayerLevel,PlayerMoney,PlayerJob,PlayerFaction &..... the method i use it that i get each key of each row when player connects and i set that key to player elementdata for example: local accData = singleQuery("SELECT * FROM users WHERE Name=? AND Key=? LIMIT 1",username,password) setElementData(source,"Number",tonumber(accData.Number)) setElementData(source,"Drugs",tonumber(accData.Drugs)) setElementData(source,"Faction",tonumber(accData.Faction)) setElementData(source,"Warns",tonumber(accData.Warns)) setElementData(source,"Email",(accData.Email)) i heard from someone that this method is awful and it is like that you are ddosing your players,also i saw some posts about setElementData in this forum that say this method must be replaced with another methods for works that trigger too much! can you tell me why? and do you know any better method for loading my players datas from sql ? and another Question: if i update Player data in sql once that data gets changed it can make server lag? for example i want to change PlayerMoney value once its changed,so it is possible for a player too change his money amount 100 times in a 30minutes,it can make lags or .... ? sorry for bad english
  6. do you have better method instead of element data?
  7. hi, i am editing a gui resource that uses local x, y = guiGetScreenSize() local xx, yy = x / 1600, y / 900 GUI.window[1] = guiCreateWindow((x - (xx * 829)) / 2, (y - (yy * 589)) / 2, xx * 829, yy * 589, "Panel", false) for width and height and x & y (it is cause of many players use low resolution) so my question is how i can get new buttons,laybels,.... x , y , width , height ???? also it is relative x,y,width,height of a new picture that i want to add(got by GUIEditor) GUIEditor.staticimage[1] = guiCreateStaticImage(0.13, 0.09, 0.77, 0.84, "bg.png", true) GUIEditor.staticimage[2] = guiCreateStaticImage(0.07, 0.06, 0.85, 0.88, "x.png", true, GUIEditor.staticimage[1]) and it is absolute x,y,width,height of a new picture that i want to add(got by GUIEditor) GUIEditor.staticimage[1] = guiCreateStaticImage(178, 69, 1052, 645, "bg.png", false) GUIEditor.staticimage[2] = guiCreateStaticImage(74, 39, 894, 568, "x.png", false, GUIEditor.staticimage[1])
  8. Hi guys i want to make a tabpanel and then change its background to a picture!also i need to show some labels on tabpanel! GUI.window[1] = guiCreateWindow((x - (xx * 829)) / 2, (y - (yy * 589)) / 2, xx * 829, yy * 589, "Police Panel", false) guiWindowSetSizable(GUI.window[1], false) GUI.staticimage[1] = guiCreateStaticImage(xx * 10, yy * 21, xx * 809, yy * 558, "10.png", false, GUI.window[1]) GUI.tabpanel[1] = guiCreateTabPanel(0, 0, xx * 809, yy * 558, false, GUI.staticimage[1]) GUI.tab[1] = guiCreateTab("Stats", GUI.tabpanel[1]) GUI.tab[2] = guiCreateTab("Criminals", GUI.tabpanel[1]) GUI.label[1] = guiCreateLabel(xx * 20, yy * 40, xx * 200, yy * 70, "Hello "..getPlayerName(localPlayer), false, GUI.tab[1]) GUI.label[2] = guiCreateLabel(xx * 20, yy * 80, xx * 400, yy * 70, "Rank: ", false, GUI.tab[1]) GUI.label[3] = guiCreateLabel(xx * 20, yy * 120, xx * 200, yy * 70, "ID: ", false, GUI.tab[1]) GUI.label[4] = guiCreateLabel(xx * 20, yy * 160, xx * 200, yy * 70, "Kills: ", false, GUI.tab[1]) i tried creating a staticimage after tabpanel but,result was :~!
  9. Hi,i want to make a gui stats panel this is the code made by GUIEditor resource! --[[------------------------------------------------- Notes: > This code is using a relative image filepath. This will only work as long as the location it is from always exists, and the resource it is part of is running. To ensure it does not break, it is highly encouraged to move images into your local resource and reference them there. --]]------------------------------------------------- GUIEditor = { tab = {}, staticimage = {}, tabpanel = {}, label = {}, window = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(124, 77, 1135, 638, "", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.staticimage[1] = guiCreateStaticImage(9, 9, 1107, 619, "Data/Images/back.png", false, GUIEditor.window[1]) GUIEditor.tabpanel[1] = guiCreateTabPanel(0, 11, 1107, 608, false, GUIEditor.staticimage[1]) GUIEditor.tab[1] = guiCreateTab("Stats", GUIEditor.tabpanel[1]) GUIEditor.label[1] = guiCreateLabel(34, 76, 222, 31, "Name: ..getPlayerName(localPlayer)", false, GUIEditor.tab[1]) guiLabelSetColor(GUIEditor.label[1], 254, 0, 0) GUIEditor.label[2] = guiCreateLabel(34, 135, 222, 35, "Level", false, GUIEditor.tab[1]) end ) for Second Label called Level i need to get player level with getElementData and put it after Level: ,any help plz?
  10. not working!! i solved Engine problem with this code: function engine(player) local veh = getPedOccupiedVehicle (player) setVehicleEngineState ( veh, false ) end addEventHandler("onVehicleEnter", getRootElement(), engine) but i don't have any idea about car locks!it is so crazy that a player can leave a vehicle while it is locked and it doesn't get unlocked!
  11. hi, i want to make a system that when player leaves a vehicle, engine turns off and if Vehicle was locked, it gets Unlocked! so i made this in Server Side: addEventHandler ("onPlayerVehicleExit", getRootElement(), function(theVehicle, leftSeat, jackerPlayer) if leftSeat == 0 and not jackerPlayer then setVehicleEngineState(theVehicle, false ) setVehicleLocked(theVehicle, false) end end) but it doesn't work(without any warning or error) and Vehicle is still locked and Engine is on when you enter the vehicle! do you know what i must do? tnx
  12. Hi my meta is this: <meta> <script src="client.lua" type="client" /> <script src="server.lua" type="server" /> <file src="Data/filename.png" /> </meta> and this is my client side code: local seconds = getTickCount() / 1000 local angle = math.sin(seconds) * 80 dxDrawImage ( screenWidth/2 - 50, 0, 100, 240, 'filename.png', angle, 0, -120 ) but it says Error Loading image @ 'dxDrawImage' [filename.png] in Debug Box! where i did wrong? it is just a simple wiki example that i used
  13. well i placed it with several times test, but 2 questions 1-is it any resource or misc that helps me to get sw and sh point of screen? 2- you used local sw, sh = guiGetScreenSize() so this will place Progress bar in a place i choosed for all players with any Resolution right? thank you @Pirulax & @SaNor
  14. ERROR: client.lua:10: attempt to compare nil with number well i fixed it, in line 10 reload must change to RELOAD_TIME Thanks, and can you tell me how i can get x y z of screen? cause i need to change progress bar place
  15. hi, i made a function that lets players jump with their car but i need to add a cooldown for it cause i don't want them to go helping nasa with their cars,just a simple jump with 3 seconds cooldown before next jump,so they can't jump to high function jump() local vehicle = getPedOccupiedVehicle(localPlayer) if(vehicle)then local sx, sy, sz = getElementVelocity(vehicle) setElementVelocity(vehicle, sx, sy, sz+0.33) end end and if you know how i can make a gui thing called cooldown bar(when this gets filled player knows that his cooldown gets ended and he is abale to jump again) plz tell, tnx
  16. Hi, i made a SQL Resource with 354 datas, now i added a new Column to it and i want to make a cmd that gets value from PRICE column and sets it in to the OPRICE column!(i want to do it with a cmd instead of changing every line OPRICE value with my hands) addCommandHandler("sqlfix", function(price, oprice) local query = dbQuery(handler, "INSERT INTO houses (OPRICE) values ('PRICE')") local result, numrows = dbPoll(query, dbpTime) if(result) then outputServerLog("Mission Done!") end end) upper code, won't work, please help, tnx
×
×
  • Create New...