Jump to content

Hero192

Members
  • Posts

    512
  • Joined

  • Last visited

Everything posted by Hero192

  1. Hero192

    I need help

    Also some Warnings,any idea? WARNING:client.lua:21: Bad argument @'guiGridListAddRow'[Expected gui-element at argument 1,got table] WARNING:client.lua:22: Bad argument @'guiGridListSetitemText''[Expected number at argument 2,got boolean] WARNING:client.lua:23: Bad argument @'guiGridListSetitemText''[Expected number at argument 2,got boolean] WARNING:client.lua:24: Bad argument @'guiGridListSetitemText''[Expected number at argument 2,got boolean]
  2. Hero192

    I need help

    Thanks but i still can't buy weapons from the list
  3. Hero192

    I need help

    Anyone it still doesn't working
  4. Please try to give me a hand on that,im sure if it solved i'll learn the gridlist stuffs.. because im stuck on that
  5. Still doesn't working, i can't warp ,i thinks there's a problem in client side,because im not good in guigridlist still learning
  6. When i selecte item and i press on the button "spawn" it doesn't warps me to the correct location,i hope ,you understand me Thanks in advance. ---Client side: local client = getLocalPlayer() local rootElement = getRootElement() --GUI: local yourX = 1366 local yourY = 768 local sx, sy = guiGetScreenSize() local x, y = sx/yourX, sy/yourY window = guiCreateWindow(493*x,227*y,366*x,294*y,"Bus stations",false) spawn = guiCreateButton(10*x,261*y,146*x,24*y,"Spawn",false,window) reject = guiCreateButton(209*x,261*y,146*x,23*y,"Cancel",false,window) grid = guiCreateGridList(9*x,21*y,348*x,236*y,false,window) guiGridListSetSelectionMode(grid,0) guiGridListAddColumn(grid,"Name:",0.38,window) guiGridListAddColumn(grid,"Location:",0.38,window) guiGridListAddColumn(grid,"Price",0.19,window) guiWindowSetSizable(window,false) guiSetVisible (window,false) Buslocations = { {"Las Venturas Airport","LV","100$",1730.42,1480.3,10.81}, ------- Edit [ X, y, z ] to Las Venturas position {"The Emerald Isle","LS","100$",2220.22,2477.71,10.82},------- Edit [ X, y, z ] to Los Santo position {"Old Venturas Strip","SF","100$",2447.32,2059.2,10.82} ------- Edit [ X, y, z ] to San Fierro position } function locations() for k,v in ipairs (Buslocations) do local row = guiGridListAddRow(grid) guiGridListSetItemText(grid, row, 1,v[1], false, false) guiGridListSetItemText(grid, row, 2,v[2], false, false) guiGridListSetItemText(grid, row, 3,v[3], false, false) guiGridListSetItemText(grid, row, 4,v[4], false, false) guiGridListSetItemText(grid, row, 5,v[5], false, false) guiGridListSetItemText(grid, row, 6,v[6], false, false) end end addEvent("bus:showGUI",true) addEventHandler("bus:showGUI",root, function (Buslocations) guiGridListClear(grid) locations() guiSetVisible (window,true) showCursor(true) end) addEventHandler("onClientGUIClick",root, function () if (source == reject) then guiSetVisible(window, false) showCursor(false) elseif (source == spawn) then guiSetVisible(window,false) showCursor(false) local cityname = guiGridListGetItemText (grid, guiGridListGetSelectedItem (grid), 1) local price = guiGridListGetItemText (grid, guiGridListGetSelectedItem (grid), 3) local x = guiGridListGetItemText (grid, guiGridListGetSelectedItem (grid), 4) local y = guiGridListGetItemText (grid, guiGridListGetSelectedItem (grid), 5) local z = guiGridListGetItemText (grid, guiGridListGetSelectedItem (grid), 6) triggerServerEvent("warpplayer",localPlayer, cityname,price,x,y,z) end end) --Server Side: local markers = { {x=1730.42, y=1480.3, z=9.81, size=1.5, int=0, dim=0, r=190, g=180, b=30, a=180}, --Spawn1 {x=2220.22, y=2477.71, z=9.82, size=1.5, int=0, dim=0, r=190, g=180, b=30, a=180}, --Spawn2 {x=2447.32, y=2059.2, z=9.82, size=1.5, int=0, dim=0, r=190, g=180, b=30, a=180}, --spawn3 -- {x=1633.95, y=1831.68, z=9.82, size=1.5, int=0, dim=0, r=190, g=180, b=30, a=180}, } addEventHandler("onResourceStart",resourceRoot, function () for index, pos in pairs(markers) do local marker = createMarker(pos.x, pos.y, pos.z, "cylinder", pos.size, pos.r, pos.g, pos.b, pos.a) setElementInterior (marker, pos.int) setElementDimension(marker, pos.dim) addEventHandler("onMarkerHit",marker,MarkerHit) end end) function MarkerHit(player, dim) if (dim and getElementType(player) == "player") then triggerClientEvent(player,"bus:showGUI",player,Buslocations) end end addEvent ("warpplayer",true) addEventHandler ("warpplayer",getRootElement(), function (cityname,price,x,y,z) if getElementZoneName (source) == cityname then if ( getPlayerMoney ( source ) < 100 ) then outputChatBox("You need 100$ to Travel.", source, 255,0,0) else takePlayerMoney (source,500) setTimer(spawn,4000,1,source) spawn = spawnPlayer(client, x,y,z) fadeCamera ( source, false, 1.0, 0, 0, 0 ) end end end)
  7. Hero192

    I need help

    Hello guys im trying to make a small shop for 24/7 Shop but i stuck again in guiGridList and in triggering to take player and to buy weapon from list also something in guiGridList broken im not professional on it,please helps me to solve this i will be happy for that, thanks in advance. --Client Side: local client = getLocalPlayer() window = guiCreateWindow(519,214,347,282,"24/7 Shop",false) sevenShopList = guiCreateGridList(11,25,326,218,false,window) guiGridListSetSelectionMode(sevenShopList,0) guiGridListAddColumn(sevenShopList,"ID:",0.19,window) guiGridListAddColumn(sevenShopList,"Name:",0.38,window) guiGridListAddColumn(sevenShopList,"Price",0.38,window) buy = guiCreateButton(13,249,134,23,"Buy",false,window) reject = guiCreateButton(199,249,134,23,"Close ",false,window) guiWindowSetSizable(window,false) guiSetVisible (window,false) addEvent("sevenShop:showGUI",true) addEventHandler("sevenShop:showGUI",root, function (sevenShop) guiGridListClear(sevenShop) for i,v in pairs(sevenShop) do local row = guiGridListAddRow(sevenShop) guiGridListSetItemText(sevenShopList, row, 1, getWeaponNameFromID(v[2]), false, false) end guiSetVisible (window,true) showCursor(true) end) addEventHandler("onClientGUIClick",root, function () if (source == reject) then guiSetVisible(window, false) showCursor(false) elseif (source == accept) then local weaponName = guiGridListGetItemText(sevenShopList,guiGridListGetSelectedItem(sevenShopList),2) if row and col and row ~= -1 and col ~= -1 then local weaponName = guiGridListGetItemText(sevenShopList, row, col) triggerServerEvent("weapon_Name",client,client,getWeaponNameFromID(weaponName)) guiSetVisible(window,false) showCursor(false) end end end) --Server Side: local sevenshopmarkers = { {x=2184.56, y=1996.33, z=10.82, size=1.5, int=0, dim=0, r=0, g=165, b=180, a=170} } local sevenShoplist = { --RandomID[1],WeaponID[2],Price[3],ItemPriceTable[4]. {1,1,"100$",100}, {2,2,"2,400$",2400}, {3,3,"1,000$",1000}, {4,4,"1,000$",1000}, {5,5,"1,000$",1000}, {6,6,"1,000$",1000}, {7,7,"1,000$",1000}, {8,8,"1,000$",1000}, {9,9,"1,000$",1000}, {10,10,"1,000$",1000}, } addEventHandler("onResourceStart",resourceRoot, function () for index, pos in pairs(sevenshopmarkers) do local sevenshopmarkers = createMarker(pos.x, pos.y, pos.z-1, "cylinder", pos.size, pos.r, pos.g, pos.b, pos.a) setElementInterior (sevenshopmarkers, pos.int) setElementDimension(sevenshopmarkers, pos.dim) addEventHandler("onMarkerHit",sevenshopmarkers,MarkerHit) createBlip(pos.bx, pos.by, 100, 17, 2, 255, 255, 255, 255, 0, 400) end end) function MarkerHit(player, dim) if (dim and getElementType(player) == "player") then triggerClientEvent(player,"sevenShop:showGUI",player,sevenShop) end end g_Root = getRootElement() resourceRoot = getResourceRootElement(getThisResource()) function giveClientWeapons(sevenShop) giveWeapon(client, getWeaponIDFromName(sevenShoplist),1) takePlayerMoney( client, 100 ) end addEvent( "weapon_Name", true ) addEventHandler("weapon_Name", g_Root, giveClientWeapons)
  8. What's the meaning of this type: button == "left" and state == "up" Why we uses that and what does that mean if button == "left" and state == "up" then --code end
  9. Any one can give me good idea or explain to me how to use the guigridlist please
  10. Hello guys,im trying to make an transporter system, with guiGridList but im not really good in handling guiGridList.., i tried harder to solve it but the solution is, when i selecte an item and i click on Spawn i do not warp to the right place, i just stay in my place Please correcte me to understand my fault,here's my code about guiGridList ,Marker stuffs are fine also the Code gives 0 errors --Client side: addEvent("showGUI",true) addEventHandler("showGUI",root, function (Buslocations) guiGridListClear(grid) for i, v in pairs(Buslocations) do local row = guiGridListAddRow(grid) guiGridListSetItemText(grid, row, 1,v[1], false, false) guiGridListSetItemText(grid, row, 2,v[2], false, false) guiGridListSetItemText(grid, row, 3,v[3], false, false) end guiSetVisible (window,true) showCursor(true) end) addEventHandler("onClientGUIClick",root, function () if (source == reject) then guiSetVisible(window, false) showCursor(false) elseif (source == spawn) then guiSetVisible(window,false) showCursor(false) triggerServerEvent("warpplayer",client) end end) --Server Side: Buslocations = { {"Las Venturas","LV","100$"}, {"Los Santos","LS","100$"}, {"San Fierro","SF","100$"}, } function setPedSpawnCity (player,x,y,z,I,D,R) setElementPosition (player,x,y,z) setElementInterior (player,I) setElementDimension (player,D) setPedRotation (player,R) end function spawn1(player) setPedSpawnCity (player,1730.42, 1480.3, 10.81120,0,0,270) outputChatBox("Spawned successfully",player, 0, 255, 0) fadeCamera (player,true, 1.0, 0, 0, 0 ) end function spawn2(player) setPedSpawnCity (player,2220.22, 2477.71, 10.82120,0,0,270) outputChatBox("Spawned successfully",player, 0, 255, 0) fadeCamera (player,true, 1.0, 0, 0, 0 ) end addEvent ("warpplayer",true) addEventHandler ("warpplayer",getRootElement(), function () if getElementZoneName (source) == "Las Venturas Airport" then if ( getPlayerMoney ( source ) < 100 ) then outputChatBox("You need 100$ to Travel.", source, 255,0,0) else takePlayerMoney (source,500) setTimer(spawn1,4000,1,source) fadeCamera ( source, false, 1.0, 0, 0, 0 ) end elseif getElementZoneName (source) == "The Emerald Isle" then if ( getPlayerMoney ( source ) < 100 ) then outputChatBox("You need 100$ to Travel.", source, 255,0,0) else takePlayerMoney (source,500) setTimer(spawn2,4000,1,source) fadeCamera ( source, false, 1.0, 0, 0, 0 ) end end end)
  11. Hey guys anyone have an example for saving CJ Clothes? thanks in advance !
  12. Hello guys im stuck in making rectangle as a GUI , i mean, i want when i hit the marker, the Rectangle Shows and in this Rectangle i can add another rectangle as a Button when i click it Rectangle as a GUI must be invisible..etc If you understand what i mean,please tell me what should i do,Anyone knows how?
  13. I want when i hit the markers the Windows shows it doesn't works! the markers shows but when i hit the marker the gui still invisible local markers = { {1642.79126, -2238.50684, 12.4969}; {1674.19836, 1448.01843, 9.7}; {-1421.77917, -287.76422, 13.14844}; {1633.95, 1831.68, 9.82}; } local Marker = {} for i=1, #markers do Marker[i] = createMarker(markers[i][1], markers[i][2], markers[i][3],"cylinder",1.3,190,180,30,170) end function MarkerHit(hitPlayer,matchingDimension) guiSetVisible (window,true) showCursor (true) end addEventHandler ("onClientMarkerHit",Marker,MarkerHit)
  14. Hello guys, i want flags shows in the scoreboard how to do that?
  15. Never Mind i solved it alone
  16. Hello guys, i have a problem im making an system that when you click a button you warp from => To Other possition works succesfully but only SF doesn't works when you click on the SF Button it gives this error: WARNING: server.lua:2: Bad argument @ 'setPedRoation' [Expected element at argument 1,got nil] server side: function setPedSpawnCity (player,x,y,z,I,D,R) setElementPosition (player,x,y,z) setElementInterior (player,I) setElementDimension (player,D) setPedRotation (player,R) end function spawnLV(player) setPedSpawnCity (player,1683.73474, 1452.60303, 10.77120,0,0,270) outputChatBox("Was taken to the city Las Venturas successfully",player,0,255,0) fadeCamera (player,true, 1.0, 0, 0, 0 ) end function spawnLS(player) setPedSpawnCity (player,1644.62012, -2245.79639, 13.48906,0,0,180) outputChatBox("Was taken to the city Los Santos successfully",player,0,255,0) fadeCamera (player,true, 1.0, 0, 0, 0 ) end function spawnSF(player) setPedSpawnCity (player,-1425.28064, -292.23923, 14.14844,0,0,140) outputChatBox("Was taken to the city San Fierro successfully",player,0,255, 0) fadeCamera (player,true, 1.0, 0, 0, 0 ) end --client side SF Button function San_Fierro() if (source == SF_button) then guiSetVisible(window, false) triggerServerEvent ("traveltoSF",localPlayer) showCursor(false) end end addEventHandler("onClientGUIClick", SF_button, San_Fierro, false )
  17. Hey, how to count player accounts in the server? which functions / events should i use to check how many account registered in the server
×
×
  • Create New...