Xwad Posted January 29, 2015 Share Posted January 29, 2015 Hi i need a team shop for my server. I mean for example : ak47 can only buy team 1 but m4 can buy only team 2. Is there any rescource for this? Thank you! Link to comment
xeon17 Posted January 29, 2015 Share Posted January 29, 2015 As far i know no , but it's pretty easy to create it. Just check does the player have a team and the team name , before the ammu GUI apper. Link to comment
Bean666 Posted January 31, 2015 Share Posted January 31, 2015 this functions might help you. getPlayerTeam getTeamName Link to comment
Xwad Posted January 31, 2015 Author Share Posted January 31, 2015 its a cool script i made 2 maerker and i replaced the guns and it works. But i have a problem when i passed over the marker then there i cant buy the shotgun i click on it and nothing happens. The other weapons works only the shotgun has error. here is the code : Client.lua local marker = createMarker(222.2, 1866.1, 13.1,"cylinder",2.0,0,255,0,255) function draw() base = dxDrawRectangle(358, 185, 456, 385, tocolor(1, 3, 0, 150), false) dxDrawLine(358, 445, 811, 445, tocolor(255, 255, 255, 255), 1, false) dxDrawText("Weapon Shop", 462, 195, 709, 241, tocolor(0, 255, 0, 255), 1.50, "pricedown", "left", "top", false, false, false, false, false) dxDrawText("Weapon Shop By Shaman\nCopyright By Shaman 2015", 363, 466, 522, 556, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("Close", 700, 518, 825, 562, tocolor(255, 255, 255, 255), 1.30, "pricedown", "left", "top", false, false, false, false, false) dxDrawText("Browning", 377, 297, 487, 347, tocolor(255, 255, 255, 255), 1.30, "pricedown", "left", "top", false, false, false, false, false) dxDrawText("Bazooka", 545, 300, 657, 344, tocolor(255, 255, 255, 255), 1.30, "pricedown", "left", "top", false, false, false, false, false) dxDrawText("Shotgun", 701, 300, 825, 347, tocolor(255, 255, 255, 255), 1.10, "pricedown", "left", "top", false, false, false, false, false) dxDrawText("Colt 1911", 373, 379, 483, 429, tocolor(255, 255, 255, 255), 1.30, "pricedown", "left", "top", false, false, false, false, false) dxDrawText("Thompson", 547, 379, 657, 429, tocolor(255, 255, 255, 255), 1.30, "pricedown", "left", "top", false, false, false, false, false) dxDrawText("Sniper", 701, 379, 811, 429, tocolor(255, 255, 255, 255), 1.30, "pricedown", "left", "top", false, false, false, false, false) dxDrawText("Cost-2000$", 387, 342, 482, 357, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("Cost-2000$", 552, 342, 647, 357, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("Cost-850$", 716, 342, 811, 357, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("Cost-2000$", 387, 424, 482, 439, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("Cost-2000$", 547, 424, 642, 439, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("Cost-2000$", 716, 424, 811, 439, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) showcursor (true) end button = guiCreateButton(532, 294, 105, 42, "Shotgun-1800$", true) button2 = guiCreateButton(368, 294, 105, 42, "Browning-6000$", false) button3 = guiCreateButton(699, 294, 105, 42, "rocketlauncher-3500$", false) button4 = guiCreateButton(368, 380, 105, 42, "Colt 1911-500$", false) button5 = guiCreateButton(532, 380, 105, 42, "Thompson-2800$", false) button6 = guiCreateButton(699, 380, 105, 42, "Sniper-3500$", false) button7 = guiCreateButton(691, 523, 110, 37, "Close", false) guiSetVisible(button2, false) guiSetVisible(button3, false) guiSetVisible(button4, false) guiSetVisible(button5, false) guiSetVisible(button6, false) guiSetVisible(button7, false) guiSetVisible(button, false) local drawingPanel = false; function startDrawing_CMD() if(drawingPanel == false) then addEventHandler("onClientPreRender", getRootElement(), draw); guiSetVisible(button, true) drawingPanel = true; showCursor(true) else removeEventHandler("onClientPreRender", getRootElement(), draw); guiSetVisible(button, false) drawingPanel = false; showCursor(false) end end addEventHandler("onClientMarkerHit", marker, function (p) if p == localPlayer then count = 10 addEventHandler("onClientPreRender", getRootElement(), draw); guiSetVisible(button, true) guiSetVisible(button2, true) guiSetVisible(button3, true) guiSetVisible(button4, true) guiSetVisible(button5, true) guiSetVisible(button6, true) guiSetVisible(button7, true) guiSetAlpha(button, 0) guiSetAlpha(button2, 0) guiSetAlpha(button3, 0) guiSetAlpha(button4, 0) guiSetAlpha(button5, 0) guiSetAlpha(button6, 0) guiSetAlpha(button7, 0) showCursor(true) end end ) addEventHandler("onClientGUIClick",button7,function() if ( source == button7) then removeEventHandler("onClientPreRender", getRootElement(), draw); guiSetVisible(button, false) guiSetVisible(button2, false) guiSetVisible(button3, false) guiSetVisible(button4, false) guiSetVisible(button5, false) guiSetVisible(button6, false) guiSetVisible(button7, false) showCursor(false) end end ) addEventHandler("onClientGUIClick",button2,function() if ( source == button2) then showCursor(true) triggerServerEvent ("giveweaponak47",getLocalPlayer(),giveweaponak47) end end ) addEventHandler("onClientGUIClick",button5,function() if ( source == button5) then showCursor(true) triggerServerEvent ("giveweapontec9",getLocalPlayer(),giveweapontec9) end end ) addEventHandler("onClientGUIClick",button3,function() if ( source == button3) then showCursor(true) triggerServerEvent ("giveweaponrocketlauncher",getLocalPlayer(),giveweaponrocketlauncher) end end ) addEventHandler("onClientGUIClick",button4,function() if ( source == button4) then showCursor(true) triggerServerEvent ("giveweaponcolt45",getLocalPlayer(),giveweaponcolt45) end end ) addEventHandler("onClientGUIClick",button6,function() if ( source == button6) then showCursor(true) triggerServerEvent ("giveweaponsniper",getLocalPlayer(),giveweaponsniper) end end ) addEventHandler("onClientGUIClick",button,function() if ( source == button) then showCursor(true) triggerServerEvent ("giveweaponshotgun",getLocalPlayer(),giveweaponshotgun) end end ) server.lua addEvent("giveweaponak47",true) addEventHandler("giveweaponak47",root, function() if ( getPlayerMoney (source) >= 6000 ) then takePlayerMoney(source, 6000) giveWeapon (source,30,150,true) else outputChatBox('You don\'t have enough money to buy this weapon.', source, 255, 0, 0 ) end end) addEvent("giveweaponshotgun",true) addEventHandler("giveweaponshotgun",root, function() if ( getPlayerMoney (source) >= 1800 ) then takePlayerMoney(source, 1800) giveWeapon (source,25,40,true) else outputChatBox('You don\'t have enough money to buy this weapon.', source, 255, 0, 0 ) end end) addEvent("giveweaponcolt45",true) addEventHandler("giveweaponcolt45",root, function() if ( getPlayerMoney (source) >= 500 ) then takePlayerMoney(source, 500) giveWeapon (source,22,40,true) else outputChatBox('You don\'t have enough money to buy this weapon.', source, 255, 0, 0 ) end end) addEvent("giveweaponrocketlauncher",true) addEventHandler("giveweaponrocketlauncher",root, function() if ( getPlayerMoney (source) >= 3500 ) then takePlayerMoney(source, 3500) giveWeapon (source,35,5,true) else outputChatBox('You don\'t have enough money to buy this weapon.', source, 255, 0, 0 ) end end) addEvent("giveweaponsniper",true) addEventHandler("giveweaponsniper",root, function() if ( getPlayerMoney (source) >= 3500 ) then takePlayerMoney(source, 3500) giveWeapon (source,34,40,true) else outputChatBox('You don\'t have enough money to buy this weapon.', source, 255, 0, 0 ) end end) addEvent("giveweapontec9",true) addEventHandler("giveweapontec9",root, function() if ( getPlayerMoney (source) >= 2800 ) then takePlayerMoney(source, 2800) giveWeapon (source,32,80,true) else outputChatBox('You don\'t have enough money to buy this weapon.', source, 255, 0, 0 ) end end) Link to comment
Bean666 Posted January 31, 2015 Share Posted January 31, 2015 (edited) is this my server weaponshop or my weaponshop that i released?? Edited January 31, 2015 by Guest Link to comment
Xwad Posted January 31, 2015 Author Share Posted January 31, 2015 why is it a problem that i use your weaponshop? Link to comment
Bean666 Posted January 31, 2015 Share Posted January 31, 2015 (edited) is it from my server or community? Edited January 31, 2015 by Guest Link to comment
Xwad Posted January 31, 2015 Author Share Posted January 31, 2015 i downloaded it from the community Link to comment
Xwad Posted January 31, 2015 Author Share Posted January 31, 2015 sry if i downloaded it im not know that its not allow. I delete it Link to comment
Bean666 Posted January 31, 2015 Share Posted January 31, 2015 nono . its allowed thats why its in the community i was just curious. by the way ur problem.i see no problems... but try re-writing the function of the shotgun both in client / server.lua or try to rename the giveweaponshotgun to giveweaponshot or in any different names in client and server.lua or if there is an error in /debugscript 3 just tell me Link to comment
Xwad Posted January 31, 2015 Author Share Posted January 31, 2015 but your server is very cool! Link to comment
xeon17 Posted January 31, 2015 Share Posted January 31, 2015 Problem is , his weapon shop isn't for every resolution. 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