Jump to content

yayo

Members
  • Posts

    12
  • Joined

  • Last visited

Everything posted by yayo

  1. Sorry for the noob question, should have looked more I found it. guiGridListGetSelectedItems
  2. Ok, so I have my menu, gridlist, and "OK" button all setup for my clothes store, but I cannot seem to figure out how to make it so that when you select your clothes by clicking each item on the gridlist, and then hit the OK button, it will give you what is selected on the gridlist. If you understand my problem please help me out. Heres my code if it helps... CLIENT shirts = { "blackwifebeater" "whitewifebeater" "whiteundershirt" "redplaid" "greent" "oranget" "basketball" } pants = { "greencamo" "greycamo" "greyreg" "greenreg" "whitereg" "bluejump" "redjump" } shoes = { "whitegrey" "lightgrey" "green" "blue" "black" "chucks" "red" } function setupClothesSelection() clothesmenu = guiCreateWindow(0.15,0.33,0.7,0.34,"Select your Clothes", true) clothesmenubutton = guiCreateButton(0.4,0.85,0.20,0.15, "OK",true,clothesmenu) guiWindowSetMovable(clothesmenu,false) guiWindowSetSizable(clothesmenu,false) clothesmenugrid = guiCreateGridList(0,0.1,1,0.9, true, clothesmenu) guiGridListSetSelectionMode(clothesmenugrid, 2) for key,clothesname in pairs(shirts) do local row = guiGridListAddRow(clothesmenugrid) guiGridListSetItemText(clothesmenugrid, row, 1, clothesname, false, false) end for key,clothesname in pairs(pants) do guiGridListSetItemText(clothesmenugrid, row, 2, clothesname, false, false) row = row + 1 end for key,clothesname in pairs(shoes) do guiGridListSetItemText(clothesmenugrid, row, 2, clothesname, false, false) row = row + 1 end end addEventHandler("onMarkerHit",theMarker,setupClothesSelection) SERVER clothesout = createMarker(917.0478515625, 2234.98046875, 10.848437309265, "arrow", 2.0, 255, 0, 0, 150 ) clothesin = createMarker( 919.26721191406, 2233.1640625, 5.1059565544128, "arrow", 2.0, 255, 0, 0, 150 ) theMarker = createMarker( 927.30041503906, 2232.8837890625, 5.0999999046326, "arrow", 1.5, 255, 255, 0, 255 ) setElementAlpha( theMarker, 0 ) ammunationdude = createPed ( 11, 928.93029785156, 2233.6328125, 5.0999999046326, 270 ) function clothesstoreaout( player ) if isPedInVehicle( player ) == false then setElementPosition( player, 923.44982910156, 2233.1005859375, 4.9749999046326 ) end end function clothesstoreain( source ) setElementPosition(source, 914.4033203125, 2235.2119140625, 10.8203125 ) end addEventHandler( "onMarkerHit", clothesout, clothesstoreaout ) addEventHandler( "onMarkerHit", clothesin, clothesstoreain )
  3. Figured it out, thanks.
  4. sooo, from client.lua and server.lua what should i fix? CLIENT cobrasmarker1 = createMarker(1020.6630859375, 2257.6728515625, 10.8203125, "cylinder", 1.0,255,0,0,150) function createWindow() menu = guiCreateWindow(238,177,315,171,"I got some shit for you, what you want?",false) sellbat = guiCreateButton(253,210,127,118,"Bat(2$)",false) sillknift = guiCreateButton(411,211,127,118,"Knife(100$)",false) guiSetVisible ( menu, true ) end addEventHandler( "onMarkerHit", cobrasmarker1, createWindow) function destroyWindow () guiSetVisible ( menu, false ) end addEventHandler( "onMarkerLeave", cobrasmarker1, destroyWindow ) function sellbat() if button == "left" and state == "up" then triggerServerEvent ( "sellbat2", source) outputChatBox ( "You bought a Bat!(2$)" ) end end function sellknife() if button == "left" and state == "up" then triggerServerEvent ( "sellknife2", source) outputChatBox ( "You bought a Knife(100$)" ) end end SERVER cobraped1 = createPed( 21, 1021.37109375, 2257.6953125, 10.8203125) setPedRotation( cobraped1, 90 ) function sellbat2() giveWeapon ( source, 5, 100 ) takePlayerMoney( source, 2 ) end addEvent( "onGreeting", true ) addEventHandler( "onGreeting", getRootElement(), sellbat2 ) function sellknife2() giveWeapon ( source, 4, 100 ) takePlayerMoney( source, 100 ) end addEvent( "onGreeting", true ) addEventHandler( "onGreeting", getRootElement(), sellknife2 )
  5. [code=text]cobrasmarker1 = createMarker(1020.6630859375, 2257.6728515625, 10.8203125, "cylinder", 1.0,255,0,0,150) function createWindow() GUIEditor_Window = {} GUIEditor_Button = {} menu = guiCreateWindow(238,177,315,171,"I got some shit for you, what you want?",false) sellbat = guiCreateButton(253,210,127,118,"Bat(2$)",false) sillknift = guiCreateButton(411,211,127,118,"Knife(100$)",false) guiSetVisible ( menu, true ) end addEventHandler( "onMarkerHit", cobrasmarker1, createWindow) function destroyWindow () guiSetVisible ( menu, false ) end addEventHandler( "onMarkerLeave", cobrasmarker1, destroyWindow ) function sellbat() if button == "left" and state == "up" then triggerServerEvent ( "sellbat2", getLocalPlayer()) outputChatBox ( "You bought a Bat!(2$)" ) end end function sellknife() if button == "left" and state == "up" then triggerServerEvent ( "sellknife2", getLocalPlayer()) outputChatBox ( "You bought a Knife(100$)" ) end end [/code] it returns in debugscript that createWindow is nil and a couple others too
  6. Can someone please explain to me how I can use XML to save data for my Gang System? I don't want to use MySQL yet, I just want to know how to do it with XML. Can someone please explain this? It will help a lot :DDD
  7. Or destroyElement( blipname )
  8. Never tried it, but if a blip is an element use... setElementAlpha(blipname, 0) can be 0-255.
  9. yayo

    Need XML help...

    Basically im trying to create a Gang System, with function like Create/Remove Game, Invite/Kick Player, Ivnvite/Kick leader, etc. Please someone help me out.
  10. Can someone help me to understand how to store things like Gang Members names, gang names, etc with XML instead of MySQL? Any tutorials, explanations, etc would be great!
  11. Wassup everyone, my first post on the forums :DD Anywho....My gunshop script isn't working.When I click the button, nothing happens, even though, it should. SERVER STUFF ammunationout = createMarker(2159.5419921875,943.201171875,10.8200125,'cylinder',2.0,255,0,0,150) ammunationin = createMarker(285.9794921875, -86.7666015625, 1001.5228881836,'cylinder',2.0,255,0,0,150) setElementInterior( ammunationin, 4) theMarker = createMarker ( 291.8251953125, -83.2900390625, 1001.515625, "cylinder", 1.5, 255, 255, 0, 255 ) setElementInterior( theMarker, 4) function gunshopAOUT( source ) -- defines gunshopAOUT function if isPlayerInVehicle ( source ) == false then setElementInterior( source, 4, 285.8000, -84.5470, 1001.5390) end end function gunshopAIN( source ) -- defines gunshopAIN function setElementInterior( source, 0, 2156.314453125, 942.9453125, 10.8203125) end addEventHandler( "onMarkerHit", ammunationout, gunshopAOUT ) addEventHandler( "onMarkerHit", ammunationin, gunshopAIN ) -- SELL GUNS FUNCTIONSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS function sellDeagle ( source ) giveWeapon ( source, 24, 100 ) takePlayerMoney( source, 1000 ) --COST end addEvent( "sellDeagle", true ) addEventHandler( "sellDeagle", getRootElement(), sellDeagle ) function sellM4 ( ) giveWeapon ( source, 31, 100 ) end addEvent( "sellM4", true ) addEventHandler( "sellM4", getRootElement(), sellM4 ) function sellTec9 ( ) giveWeapon ( source, 32, 100 ) end addEvent( "sellTec9", true ) addEventHandler( "sellTec9", getRootElement(), sellTec9 ) function sellShotgun ( ) giveWeapon ( source, 25, 100 ) end addEvent( "sellShotgun", true ) addEventHandler( "sellShotgun", getRootElement(), sellShotgun ) function sellRifle ( ) giveWeapon ( source, 33, 100 ) end addEvent( "sellRifle", true ) addEventHandler( "sellRifle", getRootElement(), sellRifle ) function sellSniper ( ) giveWeapon ( source, 34, 100 ) end addEvent( "sellSniper", true ) addEventHandler( "sellSniper", getRootElement(), sellSniper ) function sellColt ( ) giveWeapon ( source, 22, 100 ) end addEvent( "sellColt", true ) addEventHandler( "sellColt", getRootElement(), sellColt ) function sellMac10 ( ) giveWeapon ( source, 28, 100 ) end addEvent( "sellMac10", true ) addEventHandler( "sellMac10", getRootElement(), sellMac10 ) function sellAK47 ( ) giveWeapon ( source, 30, 100 ) end addEvent( "sellAK47", true ) addEventHandler( "sellAK47", getRootElement(), sellAK47 ) CLIENT STUFF theMarker = createMarker ( 295.83984375, -80.8115234375, 1001.515625, "cylinder", 1.5, 255, 255, 0, 0 ) function startUp ( ) setElementInterior ( theMarker, 4, 295.83984375, -80.8115234375, 1001.515625 ) GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Window[1] = guiCreateWindow(463,170,437,246,"",false) guiSetAlpha(GUIEditor_Window[1],1) sellDeagle = guiCreateButton(16,37,112,47,"Desert Eagle",false,GUIEditor_Window[1]) guiSetAlpha(sellDeagle,1) sellM4 = guiCreateButton(16,94,112,47,"M4",false,GUIEditor_Window[1]) guiSetAlpha(sellM4,1) sellTec9 = guiCreateButton(16,152,112,47,"Tec9",false,GUIEditor_Window[1]) guiSetAlpha(sellTec9,1) sellShotgun = guiCreateButton(162,152,112,47,"Shotgun",false,GUIEditor_Window[1]) guiSetAlpha(sellShotgun,1) sellRifle = guiCreateButton(162,94,112,47,"Rifle",false,GUIEditor_Window[1]) guiSetAlpha(sellRifle,1) sellSniper = guiCreateButton(162,36,112,47,"Sniper Rifle",false,GUIEditor_Window[1]) guiSetAlpha(sellSniper,1) sellColt = guiCreateButton(304,94,112,47,"Colt 45.",false,GUIEditor_Window[1]) guiSetAlpha(sellColt,1) sellMac10 = guiCreateButton(304,152,112,47,"Mac-10",false,GUIEditor_Window[1]) guiSetAlpha(sellMac10,1) sellAK47 = guiCreateButton(304,34,112,47,"AK47",false,GUIEditor_Window[1]) guiSetAlpha(sellAK47,1) guiSetVisible ( GUIEditor_Window[1], false ) addEventHandler ( "onClientGUIClick", sellDeagle, sellDeagle1, false ) addEventHandler ( "onClientGUIClick", sellM4, sellM41, false ) addEventHandler ( "onClientGUIClick", sellTec9, sellTec91, false ) addEventHandler ( "onClientGUIClick", sellShotgun, sellShotgun1, false ) addEventHandler ( "onClientGUIClick", sellRifle, sellRifle1, false ) addEventHandler ( "onClientGUIClick", sellSniper, sellSniper1, false ) addEventHandler ( "onClientGUIClick", sellColt, sellColt1, false ) addEventHandler ( "onClientGUIClick", sellMac10, sellMac101, false ) addEventHandler ( "onClientGUIClick", sellAK47, sellAK471, false ) end addEventHandler ( "onClientResourceStart", resourceRoot, startUp ) function onMarker ( hitElement ) if ( hitElement == localPlayer ) then guiSetVisible ( GUIEditor_Window[1], ( eventName == "onClientMarkerHit" and true or false ) ) end end addEventHandler ( "onClientMarkerHit", theMarker, onMarker ) addEventHandler ( "onClientMarkerLeave", theMarker, onMarker ) function sellDeagle1 ( ) if button == "left" and state == "up" then triggerServerEvent ( "sellDeagle", getLocalPlayer()) outputChatBox ( "You Have Bought 100 Ammo Of Deagle" ) end end function sellM41 ( ) if button == "left" and state == "up" then triggerServerEvent ( "sellM4", getLocalPlayer()) outputChatBox ( "You Have Bought 100 Ammo Of M4" ) end end function sellTec91 ( ) if button == "left" and state == "up" then triggerServerEvent ( "sellTec9", getLocalPlayer()) outputChatBox ( "You Have Bought 100 Ammo Of Tec9" ) end end function sellShotgun1 ( ) if button == "left" and state == "up" then outputChatBox ( "You Have Bought 100 Ammo Of Shotgun" ) end end function sellRifle1 ( ) if button == "left" and state == "up" then triggerServerEvent ( "sellRifle", getLocalPlayer()) outputChatBox ( "You Have Bought 100 Ammo Of Country Rifle" ) end end function sellSniper1 ( ) if button == "left" and state == "up" then triggerServerEvent ( "sellSniper", getLocalPlayer()) outputChatBox ( "You Have Bought 100 Ammo Of Sniper" ) end end function sellColt1 ( ) if button == "left" and state == "up" then triggerServerEvent ( "sellColt", getLocalPlayer()) outputChatBox ( "You Have Bought 100 Ammo Of Colt 45." ) end end function sellMac101 ( ) if button == "left" and state == "up" then triggerServerEvent ( "sellMac10", getLocalPlayer()) outputChatBox ( "You Have Bought 100 Ammo Of Mac-10" ) end end function sellAK471 ( ) if button == "left" and state == "up" then triggerServerEvent ( "sellAK47", getLocalPlayer()) outputChatBox ( "You Have Bought 100 Ammo Of AK47" ) end end Any help ill appreciate it!
×
×
  • Create New...