Error123 Posted March 8, 2013 Share Posted March 8, 2013 (edited) Thank you for helping Edited March 11, 2013 by Guest Link to comment
Error123 Posted March 9, 2013 Author Share Posted March 9, 2013 (edited) deleted Edited March 11, 2013 by Guest Link to comment
OGF Posted March 9, 2013 Share Posted March 9, 2013 Replace localPlayer with 'root' in all the triggerServerEvent 's. Link to comment
Castillo Posted March 9, 2013 Share Posted March 9, 2013 That doesn't make any sense, OGF, localPlayer is not the problem, and his problem is only on line 86. This line: triggerServerEvent ( "buyGuns" ) Should be: triggerServerEvent ( "buyGuns", localPlayer ) Link to comment
Error123 Posted March 9, 2013 Author Share Posted March 9, 2013 didn't work, when i press the button of wep1 nothin happen, it don't give me anywep or take my money off, it don't even bug Link to comment
Sasu Posted March 9, 2013 Share Posted March 9, 2013 Post the script that you have again. Link to comment
Castillo Posted March 9, 2013 Share Posted March 9, 2013 -- All rights reserved to SARPG>TNT -- Do NOT Copy this or Edit it --// gui GUIEditor = { label = {}, staticimage = {}, } wepsWin = guiCreateWindow(58, 10, 568, 493, "SARPG gun shop", false) guiWindowSetSizable(wepsWin, false) guiSetAlpha(wepsWin, 0.90) guiSetProperty(wepsWin, "CaptionColour", "C8F44E05") GUIEditor.label[1] = guiCreateLabel(20, 30, 520, 30, "Welcome to SARPG weapon shop, to buy any weapon just chose one and buy it, make sure you have enough money.", false, wepsWin) guiSetFont(GUIEditor.label[1], "default-bold-small") guiLabelSetColor(GUIEditor.label[1], 64, 228, 20) guiLabelSetHorizontalAlign(GUIEditor.label[1], "left", true) guiSetVisible( wepsWin, false ) -- // Gui Buttons wep1 = guiCreateButton(19, 144, 76, 43, "Buy 20 ammo of Deagle for $80", false, wepsWin) guiSetFont(wep1, "default-small") wep2 = guiCreateButton(109, 144, 75, 43, "Buy 20 ammo of Silenced for $60", false, wepsWin) guiSetFont(wep2, "default-small") wep3 = guiCreateButton(199, 144, 75, 43, "Buy 20 ammo of Pistol for $70", false, wepsWin) guiSetFont(wep3, "default-small") wep5 = guiCreateButton(381, 144, 75, 43, "Buy 30 ammo of Sawnoff for $350", false, wepsWin) guiSetFont(wep5, "default-small") wep4 = guiCreateButton(289, 144, 75, 43, "Buy 40 ammo of ShotGun for $300", false, wepsWin) guiSetFont(wep4, "default-small") wep6 = guiCreateButton(473, 144, 75, 43, "Buy 20 ammo of CombatShotgun for $500", false, wepsWin) guiSetFont(wep6, "default-small") wep7 = guiCreateButton(19, 285, 76, 43, "Buy 100 ammo of Uzi for $450", false, wepsWin) guiSetFont(wep7, "default-small") wep12 = guiCreateButton(473, 285, 76, 43, "Buy 10 ammo of Rifle for $60", false, wepsWin) guiSetFont(wep12, "default-small") wep11 = guiCreateButton(382, 285, 76, 43, "Buy 50 ammo of M4 for $250", false, wepsWin) guiSetFont(wep11, "default-small") wep10 = guiCreateButton(288, 285, 76, 43, "Buy 50 ammo of AK-47 for $210", false, wepsWin) guiSetFont(wep10, "default-small") wep9 = guiCreateButton(196, 285, 76, 43, "Buy 200 ammo of MP5 for $400", false, wepsWin) guiSetFont(wep9, "default-small") wep8 = guiCreateButton(105, 285, 76, 43, "Buy 100 ammo of tec-9 for $450", false, wepsWin) guiSetFont(wep8, "default-small") wep17 = guiCreateButton(382, 433, 76, 43, "Buy 10 Satchels for $10000", false, wepsWin) guiSetFont(wep17, "default-small") wep16 = guiCreateButton(288, 433, 76, 43, "Buy 10 Grenades for $8000", false, wepsWin) guiSetFont(wep16, "default-small") wep15 = guiCreateButton(196, 433, 76, 43, "Buy a Knife for $1500", false, wepsWin) guiSetFont(wep15, "default-small") wep14 = guiCreateButton(105, 433, 76, 43, "Buy a Katana for $1000", false, wepsWin) guiSetFont(wep14, "default-small") wep13 = guiCreateButton(19, 433, 76, 43, "Buy 10 ammo of Sniper for $80", false, wepsWin) guiSetFont(wep13, "default-small") closeBtn = guiCreateButton(473, 454, 77, 22, "Close", false, wepsWin) BTNS = { wep1, wep2, wep3, wep4, wep5, wep6, wep7, wep8, wep9, wep10, wep11, wep12, wep13, wep14, wep15, wep16, wep17 } --// gui images --[[GUIEditor.staticimage[1] = guiCreateStaticImage(24, 73, 66, 61, ":gunshop/images/DEAGLE.png", false, wepsWin) GUIEditor.staticimage[2] = guiCreateStaticImage(109, 74, 69, 66, ":gunshop/images/SILENCED.png", false, wepsWin) GUIEditor.staticimage[3] = guiCreateStaticImage(203, 74, 67, 64, ":gunshop/images/COLT45.png", false, wepsWin) GUIEditor.staticimage[4] = guiCreateStaticImage(289, 74, 71, 69, ":gunshop/images/SHOTGUN.png", false, wepsWin) GUIEditor.staticimage[5] = guiCreateStaticImage(381, 74, 68, 69, ":gunshop/images/SAWNOFF.png", false, wepsWin) GUIEditor.staticimage[6] = guiCreateStaticImage(473, 74, 72, 68, ":gunshop/images/COMBAT.png", false, wepsWin) GUIEditor.staticimage[7] = guiCreateStaticImage(22, 215, 69, 70, ":gunshop/images/MICROUZI.png", false, wepsWin) GUIEditor.staticimage[8] = guiCreateStaticImage(109, 217, 69, 68, ":gunshop/images/TEC9.png", false, wepsWin) GUIEditor.staticimage[10] = guiCreateStaticImage(289, 218, 70, 67, ":gunshop/images/AK47.png", false, wepsWin) GUIEditor.staticimage[11] = guiCreateStaticImage(198, 218, 72, 68, ":gunshop/images/MP5.png", false, wepsWin) GUIEditor.staticimage[12] = guiCreateStaticImage(381, 218, 77, 66, ":gunshop/images/M4.png", false, wepsWin) GUIEditor.staticimage[13] = guiCreateStaticImage(473, 218, 75, 67, ":gunshop/images/RIFLE.png", false, wepsWin) GUIEditor.staticimage[14] = guiCreateStaticImage(22, 356, 70, 74, ":gunshop/images/SNIPER.png", false, wepsWin) GUIEditor.staticimage[15] = guiCreateStaticImage(109, 356, 68, 75, ":gunshop/images/KATANA.png", false, wepsWin) GUIEditor.staticimage[17] = guiCreateStaticImage(289, 358, 72, 71, ":gunshop/images/GRENADE.png", false, wepsWin) GUIEditor.staticimage[18] = guiCreateStaticImage(381, 358, 74, 72, ":gunshop/images/SACHTEL.png", false, wepsWin) GUIEditor.staticimage[19] = guiCreateStaticImage(198, 358, 71, 73, ":gunshop/images/KNIFE.png", false, wepsWin) ]] --// Handlers addEventHandler("onClientGUIClick", closeBtn, function() guiSetVisible(wepsWin, false) showCursor(false) end, false) --// Center the Window local screenW,screenH=guiGetScreenSize() local windowW,windowH=guiGetSize(wepsWin,false) local x,y = (screenW-windowW)/2,(screenH-windowH)/2 guiSetPosition(wepsWin,x,y,false) --// Markers local gunMark = createMarker ( 295.9, -37.8, 1000.5, "cylinder", 1.5, 255, 100, 0, 175 ) setElementInterior ( gunMark, 1 ) function onHit (hitElement) guiSetVisible(wepsWin,true) showCursor(true) end addEventHandler( "onClientMarkerHit", gunMark, onHit ) function BuyWeapon(button, state) if (button == "left") then if(source == wep1) then triggerServerEvent("buyGuns", localPlayer, "weapon_Deagle") elseif(source == wep2) then triggerServerEvent("buyGuns", localPlayer, "weapon_Silenced") elseif(source == wep3) then triggerServerEvent("buyGuns", localPlayer, "weapon_Pistol") elseif(source == wep4) then triggerServerEvent("buyGuns", localPlayer, "weapon_Sawnoff") elseif(source == wep5) then triggerServerEvent("buyGuns", localPlayer, "weapon_ShutGun") elseif(source == wep6) then triggerServerEvent("buyGuns", localPlayer, "weapon_CombatShotgun") elseif(source == wep7) then triggerServerEvent("buyGuns", localPlayer, "weapon_Uzi") elseif(source == wep8) then triggerServerEvent("buyGuns", localPlayer, "weapon_Rifle") elseif(source == wep9) then triggerServerEvent("buyGuns", localPlayer, "weapon_M4") elseif(source == wep10) then triggerServerEvent("buyGuns", localPlayer, "weapon_AK") elseif(source == wep11) then triggerServerEvent("buyGuns", localPlayer, "weapon_MP5") elseif(source == wep12) then triggerServerEvent("buyGuns", localPlayer, "weapon_tec") elseif(source == wep13) then triggerServerEvent("buyGuns", localPlayer, "weapon_Satchels") elseif(source == wep14) then triggerServerEvent("buyGuns", localPlayer, "weapon_Grenades") elseif(source == wep15) then triggerServerEvent("buyGuns", localPlayer, "weapon_Knife") elseif(source == wep16) then triggerServerEvent("buyGuns", localPlayer, "weapon_Katana") elseif(source == wep17) then triggerServerEvent("buyGuns", localPlayer, "weapon_Sniper") end end end addEventHandler("onClientGUIClick", guiRoot, BuyWeapon ) Link to comment
OGF Posted March 9, 2013 Share Posted March 9, 2013 Looked at the other script thinking it was pasted differently since I couldn't find triggerServerEvent, my fault DURR Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now