Jump to content

FlorinSzasz

Members
  • Posts

    148
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by FlorinSzasz

  1. Server side u have to do this! local markers = {} local geradores = { {id = 1, fuelLevel = 50, maxFuelLevel = 200, state = false, position = {2397.336, -2472.24, 12.8}}, {id = 2, fuelLevel = 50, maxFuelLevel = 200, state = false, position = {150, 250, 10}}, {id = 3, fuelLevel = 50, maxFuelLevel = 200, state = false, position = {200, 300, 10}}, } -- Crie os marcadores para cada gerador na tabela for key, gerador in ipairs(geradores) do local marker = createMarker(gerador.position[1], gerador.position[2], gerador.position[3], "cylinder", 1, 255, 0, 0, 20) local markers[key] = marker setElementData(markers[key], "generatorID", gerador.id) setElementData(markers[key], "fuelLevel", gerador.fuelLevel) setElementData(markers[key], "maxFuelLevel", gerador.maxFuelLevel) setElementData(markers[key], "state", gerador.state) end addEventHandler("onPlayerMarkerHit", root, function (markerHit, matchingDimension) for k,v in ipairs(markers) do if markerHit == markers[k] then local generatorID = getElementData(markers[k], "generatorID") local fuelLevel = getElementData(markers[k], "fuelLevel") local maxFuelLevel = getElementData(markers[k], "maxFuelLevel") local state = getElementData(markers[k], "state") local x,y,z = getElementPosition( markers[k] ) triggerClientEvent(source, "AbrirGerador", root, generatorID, currentFuelLevel, fuelLevel, maxFuelLevel, state, x, y, z ) end end end) addEventHandler("onPlayerMarkerLeave", root, function (markerLeft, matchingDimension) for k,v in ipairs(markers) do if markerLeft == markers[k] then local generatorID = getElementData(markers[k], "generatorID") triggerClientEvent(source, "fecharGerador", root, generatorID) end end end) function desligarGeradorS( player, generatorID ) for i, marker in ipairs(markers) do local id = getElementData(markers[i], "generatorID") if id == generatorID then setElementData(markers[i], "state", false) end end end addEvent( "desligarGerador", true ) addEventHandler( "desligarGerador", root, desligarGeradorS ) function ligarGeradorS( player, generatorID ) for i, marker in ipairs(markers) do local id = getElementData(markers[i], "generatorID") if id == generatorID then setElementData(markers[i], "state", true) end end end addEvent( "ligarGerador", true ) addEventHandler( "ligarGerador", root, ligarGeradorS ) I just edited your code so you wont have a bug with the markers because u made the marker hit event to work for any marker u hit not only those 3 markers! Also client side u can do this here! local data = {} -- or u name it the way u want function AbrirGeradorM( generatorID, currentFuelLevel, fuelLevel, maxFuelLevel, state, x, y, z ) data["id"] = generatorID data["currentFuelLevel"] = currentFuelLevel data["fuelLevel"] = fuelLevel data["maxFuelLevel"] = maxFuelLevel data["state"] = state data["x"] = x data["y"] = y data["z"] = z setElementData( localPlayer, "AbrirGerador", true ) end addEvent( "AbrirGerador", true ) addEventHandler( "AbrirGerador", root, AbrirGeradorM ) I think this should fix the problem. And on client side u can use data from the table all over the script u dont need to setElementData to localPlayer
  2. eu zic ca e cel mai bine sa pui ce ai in fisierul s_gas_station.lua aici sa vedem exact care e problema ca altfel nu am nici macar un pic de context fata de ce ai acolo si nu stiu unde iti este buba in fisier.
  3. pff trebuie sa ai prin script un fel de functie dbConnect si la aia trebuie sa fie o variabila gen local connection = dbConnect("sqlite","gas_stations.db") -- sau ceva asemanator daca nu vad script-ul nu imi pot da seama -- si tu in dbQuery trebuie sa ai ceva asa sau asemanator local query = dbQuery(connection,"") -- intre ghilimele se va gasi ce cuprinde interogarea din script-ul pe care il folosesti -- nu stiu ce date cauta interogarea dar presupun ca sunt niste coordonate sau asa .
  4. So here is the code Server Side local connection = dbConnect("sqlite","skins.db") -- we create the db our is called skins.db u can call it any way u want if connection then -- check for connection outputDebugString("Connection with SKIN database was established") else outputDebugString("Connection with SKIN database was not established somehting went wrong") end function db_table() -- create the table in db dbExec(connection,"CREATE TABLE IF NOT EXISTS skins (id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,username TEXT,skin INTEGER)") end addEventHandler("onResourceStart",getResourceRootElement(),db_table) -- skin cost -- local cost = 1000 ---- ----- addCommandHandler("buyskin",function(thePlayer,commandName,model) if thePlayer then -- check for player local acc = getPlayerAccount( thePlayer ) -- get his account name local acc_name = getAccountName( acc ) -- get his account name if model and tonumber(model) >= 0 and tonumber(model) <= 84 then -- i choose to allow to buy the skins from model 0 to 84 u can change it the way u want also if u dont provide a model u get an message local q = dbQuery(connection,"SELECT username,skin FROM skins WHERE username=? AND skin=? LIMIT 1",tostring(acc_name),tonumber(model)) -- we select the data from to see if we have this skin already local rezult = dbPoll(q,-1) if #rezult > 0 then --- if we have rezult then we loop throgh rezult and check for key,value in ipairs(rezult) do -- loop if tonumber(value.skin) == tonumber(model) then -- check if we have this skin outputChatBox("[SKIN_SYSTEM] You have this skin already",thePlayer) end end else if getPlayerMoney(thePlayer) >= cost then dbExec(connection,"INSERT INTO skins (username,skin) VALUES (?,?)",tostring(acc_name),tonumber(model)) -- if player has more money or enough then we buy the skin and insert the data in db and take his money takePlayerMoney(thePlayer,cost) outputChatBox("[SKIN SYSTEM] You bought a new skin!",thePlayer,104,255,104) elseif getPlayerMoney(thePlayer) < cost then outputChatBox("[SKIN SYSTEM] You don have enough money to buy the skin",thePlayer) end end else outputChatBox("[SKIN_SYSTEM] Please provide the model u want to buy!",thePlayer) -- provide model message end end end) function myskins(thePlayer,commandName) if thePlayer then --- again check for player local acc = getPlayerAccount( thePlayer ) local acc_name = getAccountName( acc ) local q = dbQuery(connection,"SELECT username,skin FROM skins WHERE username=?",tostring(acc_name)) -- we select the data from db, by data i mean his skins and then send the table on client local rezult = dbPoll(q,-1) if #rezult > 0 then for key,value in ipairs(rezult) do triggerClientEvent(thePlayer,"skin_inventory",thePlayer,rezult) -- if we have rezult then we call client event skin_inventory!! end end end end addCommandHandler("myskins",myskins,false,false) Client Side function centerWindow (center_window) --- a function to put the window in the center of the screen local screenW, screenH = guiGetScreenSize() local windowW, windowH = guiGetSize(center_window, false) local x, y = (screenW - windowW) /2,(screenH - windowH) /2 return guiSetPosition(center_window, x, y, false) end addEvent("skin_inventory",true) -- we add the skin_inventory event client side so we can call it from server side function skin_inventory_gui(rezult) -- here we have our table sent from server to client skin_list = guiCreateWindow(329, 246, 465, 381, "MY SKINS", false) centerWindow(skin_list) guiWindowSetMovable(skin_list, false) guiWindowSetSizable(skin_list, false) skins = guiCreateGridList(9, 20, 376, 351, false, skin_list) guiGridListAddColumn(skins, "Description", 0.5) guiGridListAddColumn(skins, "Model/Skin Owned", 0.5) close = guiCreateButton(389, 20, 66, 21, "X", false, skin_list) guiSetProperty(close, "NormalTextColour", "FFAAAAAA") showCursor(true) for key, value in ipairs(rezult) do -- we loop through table local row = guiGridListAddRow(skins) -- so for each result we get we insert a row with guiGridListSetItemText (skins, row, 1, "Skin Model ->", false, true) -- this value guiGridListSetItemText (skins, row, 2, value.skin, false, true) --- and skin model / id end addEventHandler ( "onClientGUIClick", close, closeinventory,false) -- event for close function and button!!! end addEventHandler("skin_inventory",root,skin_inventory_gui) closeinventory = function(button,state) --- function to close the gui window if (button == "left") and (state == "up") then showCursor (false) guiSetVisible(skin_list,false) end end So this is enough to get you started!
  5. Well u have a gamemode who needs a Mysql server to run if i am not wrong so you need to install a mysql server or u can install XAMPP in your computer.
  6. Well first of all u need a place so save data u can use setAccountData or dbConnect() dbExec() if u want to go for setAccountData u dont need the others but if u know how to use a database than u can go for the other ones. I will show u later an example if u need i am at work now
  7. FlorinSzasz

    camera

    Well you should play with x ,y , z rotation. You can try rotate the camera to match your wish.
  8. If i am not wrong u can use fade camera so the teleport wont look as bad as it is.
  9. I dont think u can do that in mta or gta sa from the way the game was made, here is a topic maybe u find it usefull:
  10. Well something like this could work i never did one such system but u need something like math.random() or some kind of function to get some random numbers function bet_some_money(thePlayer,CommandName,amount) if source == thePlayer then -- check for player local playerMoney = getPlayerMoney(thePlayer) -- get how much money has the player who calls the command if amount ~= nil and type(amount) == "number" then -- check if amount is not nil and also if it is a number if amount <= playerMoney then -- chek if amount is not more than all the money he has at him now takePlayerMoney(thePlayer,amount) -- take the money local number = math.random(0,1) -- a random number also u can use a table with numbers or % if number == 0 then outputChatBox("[BET] You lose this time, maybe u have more luck next time!",thePlayer,255,104,104) elseif number == 1 then outputChatBox("[BET] You won gg man :D",thePlayer,104,255,104) givePlayerMoney(thePlayer,2*amount) -- give player 2 x amount end end end end end also this code is not tested!!!
  11. Daca nu pui partea de server din script nu am cum sa imi dau seama unde e problema. Și nu mi-ai confirmat daca evenimentul pe care eroare îl prezintă e adăugat. După răspunsul oferit cel mai probabil nu e adăugat.
  12. Eu o sa incerc sa fac un fel de server cu freeroam/race/rpg/minigames/stunt poate un sistem cu magazine ce au stock propriu și unul cu organizați îți cumperi teren clădiri etc. nush cat o să prindă dar să fie acol o sa pun acol tot ce am văzut mai cool pe serverele de samp pe care am jucat cândva și ideile pe care le am. Nu sunt scripter pro cel mai mult intermediar însă am cunostințe cât să pun în scris ceea ce îmi propun. Lucrez de 2-3 ani la el dar pe perioade, în prezent am job și sunt și la faculta cumva il termin :)) poate până la vară
  13. local test_locations = {} function test_someting() test_locations[1]=createMarker(2199.92871,-1671.48145,14.41751 - 1,"checkpoint",4.0,53,151,255,45) test_locations[2]=createMarker(2181.92944,-1713.81812,12.74913 ,"checkpoint",4.0,53,151,255,45) test_locations[3]=createMarker(2209.10229,-1658.24084,14.79899 - 1,"checkpoint",4.0,53,151,255,45) test_locations[4]=createMarker(2219.04077,-1687.14417,13.334671,"checkpoint",4.0,53,151,255,45) end addCommandHandler("test2",test_someting,false,false) local function test(hitPlayer,matchingDimension) for k,v in ipairs(test_locations) do if source == test_locations[k] then outputChatBox(""..k.."") destroyElement(test_locations[k]) end end end addEventHandler("onClientMarkerHit",getRootElement(),test) Solved, i got back to scripting after months! So in this way from all the markers i destroy only the one i hit.
  14. 1. Ai incercat să îl adaugi pe partea de server? Server Side addEvent("onLicenseServer",true) 2. Ai chemat evenimentul în momentul în care începe/porenște o resursă/script? @Vinyard poți să muți topicul la secțiune Română? (dacă e cazul)
  15. Well this works too thx . But i wonder how the game gets that markers[source] is markers[mark] i hope u can give me an ideea or someone.
  16. local test_locations = {} function test_someting() test_locations[1]=createMarker(-106.93572235107,-1150.2275390625,1.0437397956848-1,"cylinder",4.0,53,151,255,45) test_locations[2]=createMarker(-129.19007873535,-1202.5013427734,2.1060457229614,"cylinder",4.0,53,151,255,45) test_locations[3]=createMarker(-142.54978942871,-1272.1796875,2.1073033809662,"cylinder",4.0,53,151,255,45) end addCommandHandler("test2",test_someting,false,false) local function test(hitPlayer,matchingDimension) for i = 1,3 do if source == test_locations[i] then outputChatBox(""..i.."") destroyElement(test_locations[i]) end end end addEventHandler("onClientMarkerHit",getRootElement(),test) Hi guys, i try to spawn for a job more markers at once and when i hit one i want to check which one i hit. I tried to do this first time 1. i made a table and wrote the markers coords 2. i wrote a function with a ipairs loop in it to make the markers 3. i wrote the function for onClientMarkerHit event but the thing is only the first marker reacts to it and 2nd or 3rd or any other marker from table wont but they are created/spawned Is there another way to check which marker i hit from all created from a table than the method from above.
  17. i also looked up on wiki at that function didnt know how to modify it for my need. Thank you !! IT WORKS :D. I will use the string to make a 3D text with gang CapturePoints in ballas and grove gang base. In the past i did it but in a simple way and now i got back to scripting and i lost my last backup with scripts so i have to remade some of them and to fix this thing again . Thx Again!!!
  18. I try to get the value from the table or if i can remove the curly-brackets i am close but not there yet :)) cappoints = function () local Query = dbQuery(db,"SELECT SUM(capturepoints) AS CapturePoints FROM grove") local Query2 = dbQuery(db,"SELECT SUM(capturepoints) AS CapturePoints FROM ballas") local rezultat = dbPoll(Query,-1) local rezultat2 = dbPoll(Query2,-1) ------ for _, name in ipairs(rezultat) do local a = inspect(name) local string = string.gsub(a,"{","") local string2 = string.gsub(a,"}","") iprint(a) outputDebugString(""..string2.."") end end addEventHandler("onResourceStart",root,cappoints) i changed the code to debug faster. now i get "{\n CapturePoints = 1100\n}" from iprint and "{ CapturePoints = 1100 " from debug string output one more bracket left :))
  19. Hi guys! I try to output a string from json but what i get is [ [ { "CapturePoints": 1100 } ] ] and [ [ { "CapturePoints": 600 } ] ] all i want is to remove the brackets if i use fromJSON i get something like this table: 070593C8 and table: 070593F0. Here is the code cappoints = function () local Query = dbQuery(db,"SELECT SUM(capturepoints) AS CapturePoints FROM grove") local Query2 = dbQuery(db,"SELECT SUM(capturepoints) AS CapturePoints FROM ballas") local rezultat = dbPoll(Query,-1) local rezultat2 = dbPoll(Query2,-1) local abc = toJSON(rezultat) local abc2 = toJSON(rezultat2) setElementData(source,"suma",abc) setElementData(source,"suma2",abc2) outputChatBox(""..string.gsub(abc,"[[{}]]","").."",source) outputChatBox(""..string.gsub(abc2,"[[{}]]","").."",source) end addEventHandler("onPlayerJoin",root,cappoints) Thank you in advance for anyone who can help me!
  20. Thank you! It works now, also i had to remove the "LIMIT 1" otherwise it will give me a syntax error, strange usually "LIMIT" is usefull and works , even then it updates corectly. Thank you again ?.
  21. Hi guys! I try to make a business system from scratch. Everything is fine until i got to the point of making the withdraw part for example my payout is 5500$ and my bank is 11.000$ i withdraw 11k now and my db updates and the bank is 0 but when the payout time ends and my db gets updated my bank is not 5500$ is 16.500$. Also no errors in debugscript 3 Server Side local seconds = 1000 local minute = 60 * seconds local hour = 60* minute local conexiune = dbConnect( "sqlite", "afacere.db" ) if conexiune then outputDebugString( "Connection with AFACERE database was successfully established." ) else outputDebugString( "Connection with database couldn't be established." ) end afacerebase = function() dbExec(conexiune,"CREATE TABLE IF NOT EXISTS afacere (NR INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,x INTEGER,y INTEGER,z INTEGER,cost INT,owner TEXT,payout INT, time INT,balance INT)") end addEventHandler("onResourceStart",getRootElement(),afacerebase) -- s -- m -- h createAfacere = function(player,commandName,cost,payout,type,time) local owner = "DE VANZARE" local x,y,z = getElementPosition(player) local balance = 0 if time == nil then return end if tostring(type) == "h" then dbExec(conexiune,"INSERT INTO afacere (x,y,z,cost,owner,payout,time,balance) VALUES (?,?,?,?,?,?,?,?)",x,y,z,cost,owner,payout,tonumber(hour*time),balance) outputDebugString("1") elseif tostring(type) == "s" then dbExec(conexiune,"INSERT INTO afacere (x,y,z,cost,owner,payout,time,balance) VALUES (?,?,?,?,?,?,?,?)",x,y,z,cost,owner,payout,tonumber(seconds * time),balance) outputDebugString("2") elseif tostring(type) == "m" then dbExec(conexiune,"INSERT INTO afacere (x,y,z,cost,owner,payout,time,balance) VALUES (?,?,?,?,?,?,?,?)",x,y,z,cost,owner,payout,tonumber(minute * time),balance) outputDebugString("3") end createPickup(x,y,z,3,1274,1) createBlip(x,y,z,52,2.5,150,150,150,255,0,200) end addCommandHandler("afacere",createAfacere,false,false) deleteAfacere = function(player,commandName,cod) if cod == nil then return outputChatBox("[AFACERE] Nu ai introdus un ID syntax error <cod>",source) end local query = dbQuery(conexiune,"SELECT NR FROM afacere WHERE NR=? LIMIT 1",tonumber(cod)) local result = dbPoll(query,-1) if result then for k,v in ipairs(result) do if tonumber(v.NR) ~= tonumber(cod) then outputChatBox("EROR",source,255,0,0) else dbExec(conexiune,"DELETE FROM afacere WHERE NR=?",tonumber(cod)) outputChatBox("Succes",source) end end else outputChatBox("NOT FOUND 404",source,255,10,10) end end addCommandHandler("killafacere",deleteAfacere,false,false) startloading = function() local query = dbQuery(conexiune,"SELECT * FROM afacere") local result = dbPoll(query,-1) if result then for k,v in ipairs(result) do afacereglobala = createPickup(v.x,v.y,v.z,3,1274,1) createBlip(v.x,v.y,v.z,52,2.5,150,150,150,255,0,200) setElementData(afacereglobala,"afacere_ID",v.NR) setElementData(afacereglobala,"x",v.x) setElementData(afacereglobala,"y",v.y) setElementData(afacereglobala,"z",v.z) setElementData(afacereglobala,"afacere_cost",v.cost) setElementData(afacereglobala,"afacere_owner",tostring(v.owner)) setElementData(afacereglobala,"afacere_payout",v.payout) setElementData(afacereglobala,"afacere_time",v.time) setElementData(afacereglobala,"afacere_balance",v.balance) local TIMP = setTimer(start_money,v.time,1,afacereglobala); end end end addEventHandler("onResourceStart",getRootElement(),startloading) addEventHandler("onResourceStart", resourceRoot, function() for k, v in ipairs(getElementsByType("player")) do bindKey(v, "1", "down", "afacere") end end) addEventHandler("onPlayerJoin", root, function() bindKey(source, "1", "down", "afacere") end) function open_menu(p) if getElementData(p,"open_w") == false then local x,y,z = getElementPosition(p) local query = dbQuery(conexiune,"SELECT * FROM afacere") local result = dbPoll(query,-1) if result then for k,v in ipairs(result) do if getDistanceBetweenPoints3D(x,y,z,v.x,v.y,v.z) <= 2.5 then triggerClientEvent(p,"afacere_menu",p,v.NR,v.owner,v.payout,v.cost,v.balance,v.time,v.x,v.y,v.z) end end end else end end addCommandHandler("afacere", open_menu) addEvent("buy_afacere",true) buy_now = function(ID,payout,balance,timer,nume) local nume = nume dbExec(conexiune,"UPDATE afacere SET owner=? WHERE NR=?",tostring(nume),tonumber(ID)) setTimer(start_money,timer,1,afacereglobala) end addEventHandler("buy_afacere",getRootElement(),buy_now) start_money = function(afacereglobala) local ID = getElementData(afacereglobala,"afacere_ID") local x= getElementData(afacereglobala,"x") local y= getElementData(afacereglobala,"y") local z= getElementData(afacereglobala,"z") local cost getElementData(afacereglobala,"afacere_cost") local owner = getElementData(afacereglobala,"afacere_owner") local payout = getElementData(afacereglobala,"afacere_payout") local time = getElementData(afacereglobala,"afacere_time") local lock = getElementData(afacereglobala,"afacere_balance_lock") local balance = getElementData(afacereglobala,"afacere_balance") if owner ~= "DE VANZARE" then balance = balance + payout dbExec(conexiune,"UPDATE afacere SET balance=? WHERE NR=?",balance,ID) end local TIMP = setTimer(start_money,time,1,afacereglobala) setElementData(afacereglobala,"afacere_balance",balance) end addEvent("get_money",true) get_money = function(name,ids,acc_balance) local bank = tonumber(getElementData(afacereglobala,"afacere_balance")) if name ~= "DE VANZARE" then givePlayerMoney(source,acc_balance) setElementData(afacereglobala,"afacere_balance",0) dbExec(conexiune,"UPDATE afacere SET balance=? where NR=?",bank - bank,ids) end end addEventHandler("get_money",getRootElement(),get_money) Client Side local client = getLocalPlayer() local info = {} addEvent("afacere_menu",true) open_afacere_menu = function(ID,owner,payout,cost,balance,timer,x_aff,y_aff,z_aff) info[1] = ID info[2] = owner info[3] = payout info[4] = cost info[5] = balance info[6] = timer setElementData(getLocalPlayer(),"open_w",true) local screenW, screenH = guiGetScreenSize() afacerewindow = guiCreateWindow((screenW - 500) / 2, (screenH - 300) / 2, 500, 300, "AFACERE", false) guiWindowSetMovable(afacerewindow, false) guiWindowSetSizable(afacerewindow, false) BuyAfacere = guiCreateButton(15, 247, 119, 34, "BUY", false, afacerewindow) guiSetProperty(BuyAfacere, "NormalTextColour", "FFAAAAAA") SELL_afacere = guiCreateButton(154, 247, 119, 34, "SELL", false, afacerewindow) guiSetProperty(SELL_afacere, "NormalTextColour", "FFAAAAAA") GET_MONEY = guiCreateButton(293, 247, 119, 34, "GET MONEY", false, afacerewindow) guiSetProperty(GET_MONEY, "NormalTextColour", "FFAAAAAA") cancel_afacere = guiCreateButton(423, 247, 67, 34, "X", false, afacerewindow) guiSetProperty(cancel_afacere, "NormalTextColour", "FFAAAAAA") Info_afacere = guiCreateMemo(154, 15, 340, 230, "AFACERE ID : "..ID.."\nSTATUS: "..owner.."\nPAY_OUT: "..payout.."\nCOST: "..cost.."\nBALANCE: "..tostring(balance).."\nTimer for payout in minutes: "..(timer/60000).."\nX: "..x_aff.."\nY: "..y_aff.."\nZ: "..z_aff.."\n------------------------------------------------------------------------------", false,afacerewindow) guiCreateStaticImage(15,15, 128, 128,"$.png",false,afacerewindow) guiCreateStaticImage(15,120,128, 128,"money2.png",false,afacerewindow) guiMemoSetReadOnly(Info_afacere, true) showCursor(true) addEventHandler ( "onClientGUIClick",cancel_afacere, close_afacere_menu,false) addEventHandler ( "onClientGUIClick",BuyAfacere, buy_afacere_menu,false) addEventHandler("onClientGUIClick",GET_MONEY,get_money_menu,false) end addEventHandler("afacere_menu",getRootElement(),open_afacere_menu) close_afacere_menu = function(button,state) if (button == "left") and (state == "up") then showCursor (false) guiSetVisible(afacerewindow,false) setElementData(getLocalPlayer(),"open_w",false) end end buy_afacere_menu = function(button,state) if (button == "left") and (state == "up") then if info[2] == "DE VANZARE" and getPlayerMoney(getLocalPlayer()) >= info[4] then local nume = getPlayerName(getLocalPlayer()) showCursor (false) guiSetVisible(afacerewindow,false) outputChatBox("[AFACERE] Ai cumparat o afacere :D",0,50,255) setElementData(getLocalPlayer(),"open_w",false) takePlayerMoney(info[4]) triggerServerEvent("buy_afacere",getLocalPlayer(),info[1],info[3],info[5],info[6],nume) elseif info[2] ~= "DE VANZARE" then outputChatBox("[AFACERE] Aceasta afacere este detinuta deja de catre cineva",150,0,0) elseif info[2] == "DE VANZARE" and getPlayerMoney(getLocalPlayer()) < info[4] then outputChatBox("[AFACERE] Nu ai destui bani pentru a cumpara aceasta afacere",150,0,0) end end end get_money_menu = function(button,state) local name = getPlayerName(client) if (button == "left") and (state == "up") then if info[2] == "DE VANZARE" then outputChatBox("[AFACERE] Aceasta afacere nu este detinuta de tine ") elseif name == info[2] and info[5] >0 and info[5] >=16500 then guiSetVisible(afacerewindow,false) setElementData(getLocalPlayer(),"open_w",false) showCursor (false) triggerServerEvent("get_money",client,info[2],info[1],info[5]) elseif name ~= info[2] then outputChatBox("[AFACERE] Aceasta afacere nu este detinuta de tine ") end end end Here is the full code.
×
×
  • Create New...