Jump to content

kuwalda

Members
  • Posts

    92
  • Joined

  • Last visited

Details

  • Gang
    Groov Street

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

kuwalda's Achievements

Punk-@ss B*tch

Punk-@ss B*tch (12/54)

0

Reputation

  1. I have made barber shop GUI, which is called with triggerClientEvent(thePlayer, "requestBarberShopGUI", thePlayer) but whenever I try to call it, while being inside interior - nothing happens. No errors, nothing. It does work outside interors, but not inside. Like for example: LosSantosBarber = createMarker(2071.603515625, -1793.5634765625, 13.55327796936, "arrow", 1, 150, 255, 50) addEventHandler("onMarkerHit", LosSantosBarber, function (thePlayer, matchingDimension) if matchingDimension == true then triggerClientEvent(thePlayer, "requestBarberShopGUI", thePlayer) end end) This example works smoothly, but this one does not: requestBarberShop = createMarker(411.962890625, -50.1884765625, 1000.5, "cylinder", 1, 150, 255, 50) setElementInterior(requestBarberShop, 12, 411.962890625, -50.1884765625, 1000.5) addEventHandler("onMarkerHit", requestBarberShop, function (thePlayer, matchingDimension) if matchingDimension == true then triggerClientEvent(thePlayer, "requestBarberShopGUI", thePlayer) end end) Why? Where could be the problem?
  2. Hello. My goal here is quite simple - make whole map like chess table using radar areas using lua loop functions. To make it a bit clearer to you - it starts on bottom left corner of map and goes to all the way to left, then goes "one row up" and continous its story till all map is covered. Problem in this script is that - it makes only first row. Why? Where did I go wrong? I think my script is really easy to anyone to understand and get my main idea, so any help would be much appriciated. FIXED
  3. Hello. I saw one video on youtube, where guy was driving sultan with that yellow taxi object thingy on top of it. I think it was not a mod, because that object was looking kinda wierd. So my question is - is there taxi plafond as object ID in MTA? If you still dont get what I mean by that, look at this picture -> http://www.rdsd.lv/box/images/plafons.png I was looking through objects in MAP EDITOR, but couldnt manage to find it anywhere.
  4. removed looks terrible in this website box, but when you copy it in notepad, it comes up real fine!
  5. Hello! I have very tricky problem that I can`t manage to fix, maybe someone can help me out? I will make this as basic as possible. I have 2 markers: * markerX with size of 10 * markerY with size of 50 Both markerX and markerY is attached to one object. Lets say player is in both of them - he is inside markerX and markerY. When checking isElementWithinMarker(player, markerX) and isElementWithinMarker(player, markerY) it returs that it is only inside markerY and does not recognize it is also inside of markerX. My guess it is due marker overlapping, but am I right? Any help or advices would be appriciated.
  6. Hello. I have really easy, but tricky situation I can`t figure out how to write in code. Code: if tonumber(row["Record"]) > recordValueToCheckRally then recordValueToCheck = recordValueToCheckRally / 1000 oldRecord = tonumber(row["Record"]) / 1000 starpiba = (tonumber(row["Record"]) - recordValueToCheck) / 1000 elseif tonumber(row["Record"]) < recordValueToCheckDrift then recordValueToCheck = recordValueToCheckDrift oldRecord = tonumber(row["Record"]) starpiba = tonumber(row["Record"]) - recordValueToCheck end local oldRecordist = row["AccountName"] outputChatBox("[RECORD=+=RECORD]", root, 0, 255, 255) outputChatBox("Rec: "..getPlayerName(thePlayer).."", root, 0, 255, 255) outputChatBox("Map: "..getElementData(thePlayer, "raceParticipate").."", root, 0, 255, 255) outputChatBox("Old: "..oldRecord.."", root, 0, 255, 255) outputChatBox("New: "..recordValueToCheck.."", root, 0, 255, 255) outputChatBox("Difference: "..starpiba.."", root, 0, 255, 255) outputChatBox("[RECORD=+=RECORD]", root, 0, 255, 255) Basicly, I want to put / 1000 under variable if first check is positive, and put something like / 1 if second check is positive. In this way I would be able to save up some lines in my code, which already is kinda messy. By saving up some lines I mean, that under each check there would be only 1 variable, defining this / 1000 and / 1, so later I can just type my lines like this: outputChatBox("[RECORD=+=RECORD]", root, 0, 255, 255) outputChatBox("Rec: "..getPlayerName(thePlayer).."", root, 0, 255, 255) outputChatBox("Map: "..getElementData(thePlayer, "raceParticipate").."", root, 0, 255, 255) outputChatBox("Old: "..oldRecord [b]VARIABLE[/b].."", root, 0, 255, 255) outputChatBox("New: "..recordValueToCheck [b]VARIABLE[/b].."", root, 0, 255, 255) outputChatBox("Difference: "..starpiba [b]VARIABLE[/b].."", root, 0, 255, 255) I know its easy to do, but I have problems with syntax, so could someone please post the correct way to do it?
  7. Hello. I have made script that automalicly ends race for player after defined time, but it does not work(I belive clientside is wrong). Can anyone please find where did I go wrong? --trigger it from serverSide triggerClientEvent(thePlayer, "showTimeLeft", thePlayer, getTickCount() + 60000) --handle it from clientSide addEvent( "showTimeLeft", true ) addEventHandler( "showTimeLeft", getRootElement(), function (timeLeft) dxDrawText("Time left:", 19, 210, 185, 228, tocolor(0, 0, 0, 255), 1.20, "sans", "left", "top", false, false, true, false, false) dxDrawText(""..timeLeft.."", 19, 228, 165, 247, tocolor(0, 0, 0, 255), 1.25, "sans", "right", "top", false, false, true, false, false) addEventHandler("onClientRender", root, showTimeLeft) if timeLeft =< getTickCount() then removeEventHandler("onClientRender", root, showTimeLeft) triggerServerEvent("endRaceForPlayer", localPlayer) end end)
  8. So basicly what I wanted to do here is select all accounts from database, who is part of any organisation. Later on, I want to pack up those accounts in table and send them to Client side with triggerClientEvent. The problem is - how can I put them in table and then "unpack" them properly in gridlist? local accountList = mysql_query(handler,"SELECT AccountName, org_rank FROM accounts WHERE organizacija = '"..row["organizacija"].."';") table = {} for accountList,row in mysql_rows_assoc(accountList) do --add up them in table, something like this --table[AccountName] = org_rank end triggerClientEvent( thePlayer, "requestOrgGUIPanel", thePlayer, table{} ) --so later I can use it orgPanelGUI.gridlist[1] = guiCreateGridList(9, 101, 252, 265, false, orgPanelGUI.window[1]) guiGridListAddColumn(orgPanelGUI.gridlist[1], "UserName", 0.5) guiGridListAddColumn(orgPanelGUI.gridlist[1], "Rank", 0.5) for i = 1, 3 do guiGridListSetItemText(orgPanelGUI.gridlist[1], row, 1, ... , false, true) guiGridListSetItemText(orgPanelGUI.gridlist[1], row, 2, ..., false, true) end
  9. So I have mysql table which holds basiclly 2 main values: playerName and recordMap. Lets say I have 20 racing maps. If any player got time record on 11 maps, he is defined as "king", because noone can beat him(max map records for others is 9). So I have 2 main questions: * How can I count who is the "king"? Which player has the most map records? (mysql) * How can I count it with LUA? The main problem for me is that I understand SQL, but I can`t think of any resource efficient way of doing this. Any help would be appriciated.
  10. Hi. Is is possible and if it is, how can I make "player ghost cars"? With that I mean - you can see players model, nickname and car he is in, but when you drive trough him - you don`t actually hit him, you can just drive trough him. They would overlap or something like that. Is it possible and if so - which functions should I use?
  11. I have query which looks like this: local update = mysql_query(handler,"UPDATE cars SET engine = '"..upgrade.."' WHERE car_model = '"..getElementModel(getPedOccupiedVehicle(thePlayer)).."' and car_numberplate= '"..getVehiclePlateText(getPedOccupiedVehicle(thePlayer)).."' and car_owner = '"..getPlayerName(thePlayer).."';") Focus here is on SET engine = '"..upgrade.."', because it works fine like this, but when I try to set variable instead of engine, it stops working. Why? Tried like this: mysql_query(handler,"UPDATE cars SET '"..upgradojamais.."' = '"..upgrade.."' ... and like this: mysql_query(handler,"UPDATE cars SET '"..tostring(upgradojamais).."' = '"..upgrade.."' ... ,but none of them worked? Why? Variable "upgradojamais" is fine, I already checked on that. It is getting passed with function (second variable) setCarDBdata(source, "engine", upgrade)
  12. To understand what I mean, lets have a look at this picture: I have 2 rows - Marka and Cena, which stands for Model and Price. If player selects any model from the list, I can get it using this function: addEventHandler( "onClientGUIClick", root, function( ) if ( source == carShop.gridlist[1] ) then local row, col = guiGridListGetSelectedItem(carShop.gridlist[1]) if ( row == -1 ) then return end local text = guiGridListGetItemText(carShop.gridlist[1], row, col) outputChatBox("BOOM:"..text.."", localPlayer, 255, 255, 255) end end ) The problem is - I know how to return model from it, but how can I return its Price? For example, I have money calculator, which calculates how much money you will have after purchase. I know the Model which player wants to buy, but how can I get its price, which is located in same section?
  13. Hello. I have made GUI which looks something like this: and this is basicly shop GUI, where player can select car from left side and in right upper window it shows information about this car, based on its orginal handling. And my problem is - how to get those values? My solutions, maybe someone can think something out of these: * Problem is this GUI is client sided, but getModelHandling is server sided. Is there resource efficient way to somehow use it? * I store my cars in table (I added that code part below), so maybe I can add those values manualy, like {model,price,handlingProperty,handlingProperty2...}, but how to use them later on? * I could try to use guiGridListGetSelectedItem and then "in chain" put those values from table there, but I only how to make it for individual cars, not every. Like you press on first car and I already putted those values there and setVisibility for other GUI elements. Is there any way to make it work for every car in list? Please help, any advices or suggestions would be appriciated, even if you aren`t 100% about it. I could maybe try to work out something from your idea. local cars = { {579,60000}, {400,60000}, {404,28000}, {489,65000}, {505,65000}, {479,45000}, {442,45000}, {458,45000}, {602,50000}, {496,42500}, {401,41000} } carShop.gridlist[1] = guiCreateGridList(9, 32, 225, 297, false, carShop.window[1]) guiGridListAddColumn(carShop.gridlist[1], "Marka", 0.5) guiGridListAddColumn(carShop.gridlist[1], "Cena", 0.5) for i = 1, 7 do guiGridListAddRow(carShop.gridlist[1]) end for i,v in ipairs (cars) do local carName = getVehicleNameFromModel (v[1]) local row = guiGridListAddRow (carShop.gridlist[1]) guiGridListSetItemText (carShop.gridlist[1], row, 1, carName, false, true) guiGridListSetItemText (carShop.gridlist[1], row, 2, tostring(v[2]), false, true) end
×
×
  • Create New...