HeK
Members-
Posts
185 -
Joined
-
Last visited
Everything posted by HeK
-
Oh yeah, forgout about that, sorry for being "stupid" and thanks Castillo.
-
Ok i changed it to Server Side, but now it says "TakePlayerMoney" bad argument. This is how i did it: function gives () giveWeapon (source,34,40,true) takePlayerMoney(3000) end addEvent("gives",true) addEventHandler("gives",getRootElement(),gives)
-
Hey there! I really need help on this one, when i go to the shop "script" i buy some guns until i have no money and then when i kill a zombie my money comes back. Shop Script: Client Side( i used "code" for this script, for some reason i couldn't use "lua"): GUIEditor_Window = {} GUIEditor_TabPanel = {} GUIEditor_Tab = {} GUIEditor_Button = {} addEventHandler ("onClientResourceStart",getResourceRootElement(getThisResource()), function() GUIEditor_Window[1] = guiCreateWindow(0.3,0.0850,0.4000,0.4600,"Zombie Hazard - Weapon Shop",true) guiSetAlpha(GUIEditor_Window[1],1) GUIEditor_Window[2] = guiCreateWindow(0.3,0.15,0.30,0.1,"Oh damn!",true) guiSetAlpha(GUIEditor_Window[2],1) guiBringToFront(GUIEditor_Window[2]) label = guiCreateLabel (0.20,0.25,0.65,0.3,"You dont have enough money to buy that.",true,GUIEditor_Window[2]) button = guiCreateButton (0.35,0.6,0.3,0.2,"Ok",true,GUIEditor_Window[2]) GUIEditor_TabPanel[1] = guiCreateTabPanel(0.0161,0.1006,0.9678,0.8786,true,GUIEditor_Window[1]) guiSetAlpha(GUIEditor_TabPanel[1],1) GUIEditor_Tab[1] = guiCreateTab("Pistols",GUIEditor_TabPanel[1]) guiSetAlpha(GUIEditor_Tab[1],1) guiCreateStaticImage (0.051,0.2,0.2,0.25,"images/pistol.png",true,GUIEditor_Tab[1]) guiCreateStaticImage (0.4,0.2,0.2,0.25,"images/silenced.png",true,GUIEditor_Tab[1]) guiCreateStaticImage (0.75,0.2,0.2,0.25,"images/deagle.png",true,GUIEditor_Tab[1]) GUIEditor_Button[1] = guiCreateButton(0.025,0.5,0.2493,0.0934,"Pistol $100",true,GUIEditor_Tab[1]) guiSetAlpha(GUIEditor_Button[1],1) guiSetFont(GUIEditor_Button[1],"default-bold-small") GUIEditor_Button[2] = guiCreateButton(0.3786,0.5,0.2493,0.0934,"Silenced $200",true,GUIEditor_Tab[1]) guiSetAlpha(GUIEditor_Button[2],1) guiSetFont(GUIEditor_Button[2],"default-bold-small") GUIEditor_Button[3] = guiCreateButton(0.7204,0.5,0.2493,0.0934,"Desert Eagle $600",true,GUIEditor_Tab[1]) guiSetAlpha(GUIEditor_Button[3],1) guiSetFont(GUIEditor_Button[3],"default-bold-small") GUIEditor_Tab[2] = guiCreateTab("Shotguns",GUIEditor_TabPanel[1]) guiSetAlpha(GUIEditor_Tab[2],1) guiCreateStaticImage (0.051,0.2,0.2,0.25,"images/shotgun.png",true,GUIEditor_Tab[2]) guiCreateStaticImage (0.4,0.2,0.2,0.25,"images/sawnoff.png",true,GUIEditor_Tab[2]) guiCreateStaticImage (0.75,0.2,0.2,0.25,"images/SPAZ-12.png",true,GUIEditor_Tab[2]) GUIEditor_Button[4] = guiCreateButton(0.025,0.5,0.2493,0.0934,"Shotgun $500",true,GUIEditor_Tab[2]) guiSetAlpha(GUIEditor_Button[4],1) guiSetFont(GUIEditor_Button[4],"default-bold-small") GUIEditor_Button[5] = guiCreateButton(0.3786,0.5,0.2493,0.0934,"Sawn off $700",true,GUIEditor_Tab[2]) guiSetAlpha(GUIEditor_Button[5],1) guiSetFont(GUIEditor_Button[5],"default-bold-small") GUIEditor_Button[6] = guiCreateButton(0.7204,0.5,0.2493,0.0934,"SPAZ-12 $1000",true,GUIEditor_Tab[2]) guiSetAlpha(GUIEditor_Button[6],1) guiSetFont(GUIEditor_Button[6],"default-bold-small") GUIEditor_Tab[3] = guiCreateTab("SMG",GUIEditor_TabPanel[1]) guiSetAlpha(GUIEditor_Tab[3],1) guiCreateStaticImage (0.051,0.2,0.2,0.25,"images/tec9.png",true,GUIEditor_Tab[3]) guiCreateStaticImage (0.4,0.2,0.2,0.25,"images/uzi.png",true,GUIEditor_Tab[3]) guiCreateStaticImage (0.75,0.2,0.2,0.25,"images/mp5.png",true,GUIEditor_Tab[3]) GUIEditor_Button[7] = guiCreateButton(0.025,0.5,0.2493,0.0934,"TEC-9 $400",true,GUIEditor_Tab[3]) guiSetAlpha(GUIEditor_Button[7],1) guiSetFont(GUIEditor_Button[7],"default-bold-small") GUIEditor_Button[8] = guiCreateButton(0.3786,0.5,0.2493,0.0934,"Uzi $600",true,GUIEditor_Tab[3]) guiSetAlpha(GUIEditor_Button[8],1) guiSetFont(GUIEditor_Button[8],"default-bold-small") GUIEditor_Button[9] = guiCreateButton(0.7204,0.5,0.2493,0.0934,"MP5 $800",true,GUIEditor_Tab[3]) guiSetAlpha(GUIEditor_Button[9],1) guiSetFont(GUIEditor_Button[9],"default-bold-small") GUIEditor_Tab[4] = guiCreateTab("Assault Rifles",GUIEditor_TabPanel[1]) guiSetAlpha(GUIEditor_Tab[4],1) guiCreateStaticImage (0.2,0.2,0.2,0.25,"images/M4.png",true,GUIEditor_Tab[4]) guiCreateStaticImage (0.58,0.2,0.2,0.25,"images/AK-47.png",true,GUIEditor_Tab[4]) GUIEditor_Button[10] = guiCreateButton(0.18,0.5,0.2493,0.0934,"M4 $2000",true,GUIEditor_Tab[4]) guiSetAlpha(GUIEditor_Button[10],1) guiSetFont(GUIEditor_Button[10],"default-bold-small") GUIEditor_Button[11] = guiCreateButton(0.556,0.5,0.2493,0.0934,"AK-47 $1000",true,GUIEditor_Tab[4]) guiSetAlpha(GUIEditor_Button[11],1) guiSetFont(GUIEditor_Button[11],"default-bold-small") GUIEditor_Tab[5] = guiCreateTab("Sniper Rifles",GUIEditor_TabPanel[1]) guiSetAlpha(GUIEditor_Tab[5],1) guiCreateStaticImage (0.2,0.2,0.2,0.25,"images/rifle.png",true,GUIEditor_Tab[5]) guiCreateStaticImage (0.58,0.2,0.2,0.25,"images/sniper.png",true,GUIEditor_Tab[5]) GUIEditor_Button[12] = guiCreateButton(0.18,0.5,0.2493,0.0934,"Country Sniper $1000",true,GUIEditor_Tab[5]) guiSetAlpha(GUIEditor_Button[12],1) guiSetFont(GUIEditor_Button[12],"default-bold-small") GUIEditor_Button[13] = guiCreateButton(0.556,0.5,0.2493,0.0934,"Sniper $3000",true,GUIEditor_Tab[5]) guiSetAlpha(GUIEditor_Button[13],1) guiSetFont(GUIEditor_Button[13],"default-bold-small") GUIEditor_Tab[8] = guiCreateTab("Special",GUIEditor_TabPanel[1]) guiSetAlpha(GUIEditor_Tab[8],1) guiCreateStaticImage (0.2,0.2,0.2,0.25,"images/health.png",true,GUIEditor_Tab[8]) guiCreateStaticImage (0.58,0.2,0.2,0.25,"images/armor.png",true,GUIEditor_Tab[8]) GUIEditor_Button[25] = guiCreateButton(0.18,0.5,0.2493,0.0934,"Health $1000",true,GUIEditor_Tab[8]) guiSetAlpha(GUIEditor_Button[25],1) guiSetFont(GUIEditor_Button[25],"default-bold-small") GUIEditor_Button[26] = guiCreateButton(0.556,0.5,0.2493,0.0934,"Protection $1500",true,GUIEditor_Tab[8]) guiSetAlpha(GUIEditor_Button[26],1) guiSetFont(GUIEditor_Button[26],"default-bold-small") GUIEditor_Button[29] = guiCreateButton(0.85,0.0574,0.1420,0.0400,"Exit",true,GUIEditor_Window[1]) guiSetAlpha(GUIEditor_Button[29],1) guiSetFont(GUIEditor_Button[29],"default-bold-small") GUIEditor_Button[30] = guiCreateButton(0,0,0.2453,0.0854,"Exit",true,GUIEditor_Window[2]) guiSetAlpha(GUIEditor_Button[30],1) guiSetFont(GUIEditor_Button[30],"default-bold-small") guiSetVisible (GUIEditor_Window[1],false) guiSetVisible (GUIEditor_Window[2],false) end) addEventHandler("onClientGUIClick",getRootElement(), function (player) if (source == GUIEditor_Button[29]) then guiSetVisible (GUIEditor_Window[1],false) showCursor (false) elseif (source == GUIEditor_Button[30]) then guiSetVisible (GUIEditor_Window[2],false) showCursor (false) elseif (source == GUIEditor_Button[1]) then money = getPlayerMoney (source) if (money >= 100) then player = getLocalPlayer() outputChatBox ("You bought a Pistol $100",225,225,0) takePlayerMoney(100) triggerServerEvent ("give45",getLocalPlayer(),give45) else guiSetVisible(GUIEditor_Window[2],true) guiSetVisible(GUIEditor_Window[1],false) end elseif (source == GUIEditor_Button[2]) then money = getPlayerMoney (source) if (money >= 200) then player = getLocalPlayer() outputChatBox ("You bought a Silenced $200",225,225,0) takePlayerMoney(200) triggerServerEvent ("givesilenced",getLocalPlayer(),givesilenced) else guiSetVisible(GUIEditor_Window[1],false) guiSetVisible(GUIEditor_Window[2],true) end elseif (source == GUIEditor_Button[3]) then money = getPlayerMoney (source) if (money >= 600) then player = getLocalPlayer() outputChatBox ("You bought a Desert Eagle $600",225,225,0) takePlayerMoney(600) triggerServerEvent ("givedeagle",getLocalPlayer(),givedeagle) else guiSetVisible(GUIEditor_Window[1],false) guiSetVisible(GUIEditor_Window[2],true) end elseif (source == GUIEditor_Button[4]) then money = getPlayerMoney (source) if (money >= 500) then player = getLocalPlayer() outputChatBox ("You bought a Shotgun $500",225,225,0) takePlayerMoney(500) triggerServerEvent ("givesh",getLocalPlayer(),givesh) else guiSetVisible(GUIEditor_Window[1],false) guiSetVisible(GUIEditor_Window[2],true) end elseif (source == GUIEditor_Button[5]) then money = getPlayerMoney (source) if (money >= 700) then player = getLocalPlayer() outputChatBox ("You bought a Sawn Off $700",225,225,0) takePlayerMoney(700) triggerServerEvent ("giveso",getLocalPlayer(),giveso) else guiSetVisible(GUIEditor_Window[1],false) guiSetVisible(GUIEditor_Window[2],true) end elseif (source == GUIEditor_Button[6]) then money = getPlayerMoney (source) if (money >= 1000) then player = getLocalPlayer() outputChatBox ("You bought a SPAZ-12 $1000",225,225,0) takePlayerMoney(1000) triggerServerEvent ("giveSP",getLocalPlayer(),giveSP) else guiSetVisible(GUIEditor_Window[1],false) guiSetVisible(GUIEditor_Window[2],true) end elseif (source == GUIEditor_Button[7]) then money = getPlayerMoney (source) if (money >= 400) then player = getLocalPlayer() outputChatBox ("You bought a Tec-9 $400",225,225,0) takePlayerMoney(400) triggerServerEvent ("givetec",getLocalPlayer(),givetec) else guiSetVisible(GUIEditor_Window[1],false) guiSetVisible(GUIEditor_Window[2],true) end elseif (source == GUIEditor_Button[8]) then money = getPlayerMoney (source) if (money >= 600) then player = getLocalPlayer() outputChatBox ("You bought a Uzi $600",225,225,0) takePlayerMoney(600) triggerServerEvent ("giveuzi",getLocalPlayer(),giveuzi) else guiSetVisible(GUIEditor_Window[1],false) guiSetVisible(GUIEditor_Window[2],true) end elseif (source == GUIEditor_Button[9]) then money = getPlayerMoney (source) if (money >= 800) then player = getLocalPlayer() outputChatBox ("You bought a MP5 $800",225,225,0) takePlayerMoney(800) triggerServerEvent ("givemp5",getLocalPlayer(),givemp5) else guiSetVisible(GUIEditor_Window[1],false) guiSetVisible(GUIEditor_Window[2],true) end elseif (source == GUIEditor_Button[11]) then money = getPlayerMoney (source) if (money >= 1000) then player = getLocalPlayer() outputChatBox ("You bought an AK-47 $1000",225,225,0) takePlayerMoney(1000) triggerServerEvent ("giveak",getLocalPlayer(),giveak) else guiSetVisible(GUIEditor_Window[1],false) guiSetVisible(GUIEditor_Window[2],true) end elseif (source == GUIEditor_Button[10]) then money = getPlayerMoney (source) if (money >= 2000) then player = getLocalPlayer() outputChatBox ("You bought a M4 $2000",225,225,0) takePlayerMoney(2000) triggerServerEvent ("givem4",getLocalPlayer(),givem4) else guiSetVisible(GUIEditor_Window[1],false) guiSetVisible(GUIEditor_Window[2],true) end elseif (source == GUIEditor_Button[13]) then money = getPlayerMoney (source) if (money >= 3000) then player = getLocalPlayer() outputChatBox ("You bought a Sniper $3000",225,225,0) takePlayerMoney(3000) triggerServerEvent ("gives",getLocalPlayer(),gives) else guiSetVisible(GUIEditor_Window[1],false) guiSetVisible(GUIEditor_Window[2],true) end elseif (source == GUIEditor_Button[12]) then money = getPlayerMoney (source) if (money >= 1000) then player = getLocalPlayer() outputChatBox ("You bought a Country Sniper $1000",225,225,0) takePlayerMoney(1000) triggerServerEvent ("givecs",getLocalPlayer(),givecs) else guiSetVisible(GUIEditor_Window[1],false) guiSetVisible(GUIEditor_Window[2],true) end
-
Thanks again Castillo! It worked perfectly!
-
I saw this on another topic and then i edited it to use "Baseball Bat", "Shovel", "Katana" and "Chainsaw". But they come with nightsticks, golf clubs, knives. What is wrong? Server: local weaponsTable = {5, 6, 8, 9 } addEvent("onZombieSpawned",true) addEventHandler("onZombieSpawned",root, function ( ) giveWeapon ( source, math.random(#weaponsTable), 1, true ) end) Client: addEvent("Zomb_STFU",true) addEventHandler("Zomb_STFU",root, function ( zomb ) triggerServerEvent ( "onZombieSpawned", zomb ) end)
-
It did work! Thank you so much!
-
Hello guys, im trying to make a marker where you hit it, it will open a shop script, i also have a createPed there. In the end of the "Client Side" i have the function to show the GUI and in the Server side i have the marker to open it, but it isn't working. Client: tabPanel = {} buttons = {} labels = {} images = {} function main() shop_window = guiCreateWindow(340, 115, 405, 538, "Weapon Shop", false) -- Create window guiWindowSetSizable(shop_window, false) labels.Weapons = guiCreateLabel(7, 52, 53, 16, "Weapons", false, shop_window) guiLabelSetColor(labels.Weapons, 255, 0, 0) guiSetFont(labels.Weapons, "default-bold-small") tabPanel.myTabPanel = guiCreateTabPanel(60, 26, 353, 504, false, shop_window) -- Create TabPanel in the window addEventHandler("onClientGUIClick", root, buy) -- Tab 2 Buy weapons tabPanel.Tab_Loja = guiCreateTab("Buy Weapons", tabPanel.myTabPanel) images.Pistol = guiCreateStaticImage(0, 0, 101, 108, "weapons/22.png", false, tabPanel.Tab_Loja) buttons.buy_Pistol = guiCreateButton(6, 98, 103, 25, "Buy Pistol", false, tabPanel.Tab_Loja) labels.buy_Pistol = guiCreateLabel(23, 81, 81, 16, "$8.000", false, tabPanel.Tab_Loja) guiLabelSetHorizontalAlign(labels.buy_Pistol, "center", false) guiSetProperty( buttons.buy_Pistol, "HoverTextColour", "FFFFFF00" ) images.SilencedPistol = guiCreateStaticImage(125, 0, 79, 112, "weapons/23.png", false, tabPanel.Tab_Loja) buttons.buy_SilencedPistol = guiCreateButton(113, 99, 108, 29, "Buy Silenced pistol", false, tabPanel.Tab_Loja) labels.buy_SilencedPistol = guiCreateLabel(127, 81, 81, 16, "$8.300", false, tabPanel.Tab_Loja) guiLabelSetHorizontalAlign(labels.buy_SilencedPistol, "center", false) guiSetProperty( buttons.buy_SilencedPistol, "HoverTextColour", "FFFFFF00" ) buttons.buy_DesertEagle = guiCreateButton(224, 99, 103, 28, "Buy Desert eagle", false, tabPanel.Tab_Loja) images.DesertEagle = guiCreateStaticImage(229, 0, 87, 105, "weapons/24.png", false, tabPanel.Tab_Loja) labels.buy_DesertEagle = guiCreateLabel(226, 82, 91, 14, "$9.200", false, tabPanel.Tab_Loja) guiLabelSetHorizontalAlign(labels.buy_DesertEagle, "center", false) guiSetProperty( buttons.buy_DesertEagle, "HoverTextColour", "FFFFFF00" ) images.Shotgun = guiCreateStaticImage(12, 115, 96, 115, "weapons/25.png", false, tabPanel.Tab_Loja) buttons.buy_Shotgun = guiCreateButton(6, 221, 103, 25, "Buy Shotgun", false, tabPanel.Tab_Loja) labels.buy_Shotgun = guiCreateLabel(8, 204, 99, 14, "$9.100", false, tabPanel.Tab_Loja) guiLabelSetHorizontalAlign(labels.buy_Shotgun, "center", false) guiSetProperty( buttons.buy_Shotgun, "HoverTextColour", "FFFFFF00" ) images.SawnOff = guiCreateStaticImage(116, 129, 101, 98, "weapons/26.png", false, tabPanel.Tab_Loja) buttons.buy_SawnOff = guiCreateButton(114, 221, 103, 30, "Buy Sawn-off Shotgun", false, tabPanel.Tab_Loja) labels.buy_SawnOff = guiCreateLabel(115, 204, 99, 14, "$9.800", false, tabPanel.Tab_Loja) guiLabelSetHorizontalAlign(labels.buy_SawnOff, "center", false) guiSetProperty( buttons.buy_SawnOff, "HoverTextColour", "FFFFFF00" ) labels.buy_SPAZ12 = guiCreateLabel(224, 204, 99, 14, "$9.550", false, tabPanel.Tab_Loja) guiLabelSetHorizontalAlign(labels.buy_SPAZ12, "center", false) images.SPAZ12 = guiCreateStaticImage(224, 124, 98, 107, "weapons/27.png", false, tabPanel.Tab_Loja) buttons.buy_SPAZ12 = guiCreateButton(222, 221, 103, 27, "Buy SPAZ-12", false, tabPanel.Tab_Loja) guiSetProperty( buttons.buy_SPAZ12, "HoverTextColour", "FFFFFF00" ) buttons.buy_Uzi = guiCreateButton(6, 337, 103, 26, "Buy Micro Uzi", false, tabPanel.Tab_Loja) images.Uzi = guiCreateStaticImage(14, 256, 74, 75, "weapons/28.png", false, tabPanel.Tab_Loja) labels.buy_Uzi = guiCreateLabel(8, 320, 99, 14, "$9.400", false, tabPanel.Tab_Loja) guiLabelSetHorizontalAlign(labels.buy_Uzi, "center", false) guiSetProperty( buttons.buy_Uzi, "HoverTextColour", "FFFFFF00" ) images.MP5 = guiCreateStaticImage(122, 256, 82, 69, "weapons/29.png", false, tabPanel.Tab_Loja) buttons.buy_MP5 = guiCreateButton(114, 337, 103, 26, "Buy MP5", false, tabPanel.Tab_Loja) labels.buy_MP5 = guiCreateLabel(115, 320, 99, 14, "$8.900", false, tabPanel.Tab_Loja) guiLabelSetHorizontalAlign(labels.buy_MP5, "center", false) guiSetProperty( buttons.buy_MP5, "HoverTextColour", "FFFFFF00" ) images.TEC9 = guiCreateStaticImage(236, 266, 74, 63, "weapons/32.png", false, tabPanel.Tab_Loja) buttons.buy_TEC9 = guiCreateButton(222, 337, 103, 26, "Buy TEC-9", false, tabPanel.Tab_Loja) labels.buy_TEC9 = guiCreateLabel(224, 320, 99, 14, "$9.250", false, tabPanel.Tab_Loja) guiLabelSetHorizontalAlign(labels.buy_TEC9, "center", false) guiSetProperty( buttons.buy_TEC9, "HoverTextColour", "FFFFFF00" ) images.AK47 = guiCreateStaticImage(8, 360, 91, 86, "weapons/30.png", false, tabPanel.Tab_Loja) buttons.buy_AK47 = guiCreateButton(6, 447, 103, 28, "Buy AK-47", false, tabPanel.Tab_Loja) labels.buy_AK47 = guiCreateLabel(8, 431, 99, 14, "$9.900", false, tabPanel.Tab_Loja) guiLabelSetHorizontalAlign(labels.buy_AK47, "center", false) guiSetProperty( buttons.buy_AK47, "HoverTextColour", "FFFFFF00" ) labels.buy_M4 = guiCreateLabel(117, 430, 99, 14, "$10.000", false, tabPanel.Tab_Loja) guiLabelSetHorizontalAlign(labels.buy_M4, "center", false) buttons.buy_M4 = guiCreateButton(117, 447, 98, 27, "Buy M4", false, tabPanel.Tab_Loja) images.M4 = guiCreateStaticImage(117, 361, 95, 85, "weapons/31.png", false, tabPanel.Tab_Loja) guiSetProperty( buttons.buy_M4, "HoverTextColour", "FFFFFF00" ) images.Sniper = guiCreateStaticImage(214, 381, 112, 68, "weapons/icon.png", false, tabPanel.Tab_Loja) buttons.buy_Sniper = guiCreateButton(222, 447, 103, 26, "Buy Sniper", false, tabPanel.Tab_Loja) labels.buy_Sniper = guiCreateLabel(224, 431, 99, 14, "$9.500", false, tabPanel.Tab_Loja) guiLabelSetHorizontalAlign(labels.buy_Sniper, "center", false) guiSetProperty( buttons.buy_Sniper, "HoverTextColour", "FFFFFF00" ) function buyWeapon() if (source == buttons.buy_Pistol) then -- Buy > Pistol player = localPlayer local priceWeapon_Pistol = 8000 money = getPlayerMoney(source) if (money >= priceWeapon_Pistol) then outputChatBox ("You bought a #FF0000Pistol #FFFFFFfor #00ff00$#FF0000"..priceWeapon_Pistol.."", 255, 255, 255, true) takePlayerMoney(priceWeapon_Pistol) triggerServerEvent("givePistol", player, givePistol) else outputChatBox("You dont have enough money to buy Pistol.", 255, 0, 0) end elseif (source == buttons.buy_SilencedPistol) then -- Buy > Silenced pistol player = localPlayer local priceWeapon_SilencedPistol = 8300 money = getPlayerMoney (source) if (money >= priceWeapon_SilencedPistol) then outputChatBox ("You bought a #FF0000Silenced pistol #FFFFFFfor #00ff00$#FF0000"..priceWeapon_SilencedPistol.."", 255, 255, 255, true) takePlayerMoney(priceWeapon_SilencedPistol) triggerServerEvent("giveSilencedPistol", player, giveSilencedPistol) else outputChatBox("You dont have enough money to buy Silenced pistol.", 255, 0, 0) end elseif (source == buttons.buy_DesertEagle) then -- Buy > Desert eagle player = localPlayer local priceWeapon_DesertEagle = 9200 money = getPlayerMoney (source) if (money >= priceWeapon_DesertEagle) then outputChatBox ("You bought a #FF0000Desert eagle #FFFFFFfor #00ff00$#FF0000"..priceWeapon_DesertEagle.."", 255, 255, 255, true) takePlayerMoney(priceWeapon_DesertEagle) triggerServerEvent("giveDesertEagle", player, giveDesertEagle) else outputChatBox("You dont have enough money to buy Desert eagle.", 255, 0, 0) end elseif (source == buttons.buy_Shotgun) then -- Buy > Shotgun player = localPlayer local priceWeapon_Shotgun = 9100 money = getPlayerMoney (source) if (money >= priceWeapon_Shotgun) then outputChatBox ("You bought a #FF0000Shotgun #FFFFFFfor #00ff00$#FF0000"..priceWeapon_Shotgun.."", 255, 255, 255, true) takePlayerMoney(priceWeapon_Shotgun) triggerServerEvent("giveShotgun", player, giveShotgun) else outputChatBox("You dont have enough money to buy Shotgun.", 255, 0, 0) end elseif (source == buttons.buy_SawnOff) then -- Buy > Sawn-off Shotgun player = localPlayer local priceWeapon_SawnOff = 9800 money = getPlayerMoney (source) if (money >= priceWeapon_SawnOff) then outputChatBox ("You bought a #FF0000Sawn-off shotgun #FFFFFFfor #00ff00$#FF0000"..priceWeapon_SawnOff.."", 255, 255, 255, true) takePlayerMoney(priceWeapon_SawnOff) triggerServerEvent("giveSawnOff", player, giveSawnOff) else outputChatBox("You dont have enough money to buy Sawn-off shotgun.", 255, 0, 0) end elseif (source == buttons.buy_SPAZ12) then -- Buy > SPAZ-12 player = localPlayer local priceWeapon_SPAZ12 = 9550 money = getPlayerMoney (source) if (money >= priceWeapon_SPAZ12) then outputChatBox ("You bought a #FF0000SPAZ-12 #FFFFFFfor #00ff00$#FF0000"..priceWeapon_SPAZ12.."", 255, 255, 255, true) takePlayerMoney(priceWeapon_SPAZ12) triggerServerEvent("giveSPAZ12", player, giveSPAZ12) else outputChatBox("You dont have enough money to buy SPAZ-12.", 255, 0, 0) end elseif (source == buttons.buy_Uzi) then -- Buy > Micro Uzi player = localPlayer local priceWeapon_Uzi = 9400 money = getPlayerMoney (source) if (money >= priceWeapon_Uzi) then outputChatBox ("You bought a #FF0000Micro Uzi #FFFFFFfor #00ff00$#FF0000"..priceWeapon_Uzi.."", 255, 255, 255, true) takePlayerMoney(priceWeapon_Uzi) triggerServerEvent("giveUzi", player, giveUzi) else outputChatBox("You dont have enough money to buy Micro Uzi.", 255, 0, 0) end elseif (source == buttons.buy_MP5) then -- Buy > MP5 player = localPlayer local priceWeapon_MP5 = 8900 money = getPlayerMoney (source) if (money >= priceWeapon_MP5) then outputChatBox ("You bought a #FF0000MP5 #FFFFFFfor #00ff00$#FF0000"..priceWeapon_MP5.."", 255, 255, 255, true) takePlayerMoney(priceWeapon_MP5) triggerServerEvent("giveMP5", player, giveMP5) else outputChatBox("You dont have enough money to buy MP5.", 255, 0, 0) end elseif (source == buttons.buy_TEC9) then -- Buy > TEC-9 player = localPlayer local priceWeapon_TEC9 = 9250 money = getPlayerMoney (source) if (money >= priceWeapon_TEC9) then outputChatBox ("You bought a #FF0000TEC-9 #FFFFFFfor #00ff00$#FF0000"..priceWeapon_TEC9.."", 255, 255, 255, true) takePlayerMoney(priceWeapon_TEC9) triggerServerEvent("giveTEC9", player, giveTEC9) else outputChatBox("You dont have enough money to buy TEC-9.", 255, 0, 0) end elseif (source == buttons.buy_AK47) then -- Buy > AK-47 player = localPlayer local priceWeapon_AK47 = 9900 money = getPlayerMoney (source) if (money >= priceWeapon_AK47) then outputChatBox ("You bought a #FF0000AK-47 #FFFFFFfor #00ff00$#FF0000"..priceWeapon_AK47.."", 255, 255, 255, true) takePlayerMoney(priceWeapon_AK47) triggerServerEvent("giveAK47", player, giveAK47) else outputChatBox("You dont have enough money to buy AK-47.", 255, 0, 0) end elseif (source == buttons.buy_M4) then -- Buy > M4 player = localPlayer local priceWeapon_M4 = 10000 money = getPlayerMoney (source) if (money >= priceWeapon_M4) then outputChatBox ("You bought a #FF0000M4 #FFFFFFfor #00ff00$#FF0000"..priceWeapon_M4.."", 255, 255, 255, true) takePlayerMoney(priceWeapon_M4) triggerServerEvent("giveM4", player, giveM4) else outputChatBox("You dont have enough money to buy M4.", 255, 0, 0) end elseif (source == buttons.buy_Sniper) then -- Buy > Sniper player = localPlayer local priceWeapon_Sniper = 9500 money = getPlayerMoney (source) if (money >= priceWeapon_Sniper) then outputChatBox ("You bought a #FF0000Sniper #FFFFFFfor #00ff00$#FF0000"..priceWeapon_Sniper.."", 255, 255, 255, true) takePlayerMoney(priceWeapon_Sniper) triggerServerEvent("giveSniper", player, giveSniper) else outputChatBox("You dont have enough money to buy Sniper.", 255, 0, 0) end end end addEventHandler("onClientGUIClick", root, buyWeapon) function windowLabelsOnClick() local selectedTab = guiGetSelectedTab(tabPanel.myTabPanel) if (selectedTab == tabPanel.Tab_Loja) then guiSetText(labels.body, "") guiSetText(labels.body_label, "") guiSetText(labels.Skills, "") guiSetText(labels.skills_label, "") guiSetText(labels.wnd_info_vehicle, "") guiSetText(labels.vehicleFunctions_label, "")
-
Ok, Thanks 50p and Gamekiller.
-
Maybe i'll PM him, don't really wanna bother him, but maybe it's the only solution. Thanks anyway.
-
I have some problems with the "Spawn" resource by 50p, sometimes when a player dies or changes team he doesn't go to the exact team he choosed or he was. He just goes white and no Team. Screenshot: Scripts client/server (theres a lot of luas there, i just put the main ones): Client: g_Me = getLocalPlayer( ); g_root = getRootElement( ); g_ResRoot = getResourceRootElement( ); screenSize = { guiGetScreenSize( ) }; --local stripHeight = .15 * (screenSize[ 2 ]*2); letterBox = { stripHeight = screenSize[ 2 ] * .15, stripAlpha = .93, -- 0-1 animLength = 01, -- seconds animStartTick = 0, animFinishTick = 0, keepAnimating = true, flyIn = function ( ) letterBox.animStartTick = 0; addEventHandler( "onClientRender", g_root, animateLetterBox_flyIn ); setTempPedRotating( true ); end, flyOut = function ( ) letterBox.animStartTick = 0; setTempPedRotating( false ); removeEventHandler( "onClientRender", g_root, animateLetterBox_flyIn ) addEventHandler( "onClientRender", g_root, animateLetterBox_flyOut ); end, } local pedRot = 0; allHUDElements = { "ammo", "area_name", "armour", "breath", "clock", "health", "money", "radar", "vehicle_name", "weapon", } iconWidths = { [0] = 21, [1] = 15, [2] = 97, [3] = 55, [4] = 83, [5] = 72, [6] = 55, [7] = 138, [8] = 104, [9] = 59, [10] =40 , [11] =31 , [12] =41 , [14] =10 , [15] =71 , [16] =13 , [17] =10 , [18] =4 , [19] =17, [22] =35 , [23] =50 , [24] =37 , [25] =75 , [26] =67 , [27] =66 , [28] =17 , [29] =35 , [30] =70 , [31] =71 , [32] =22 , [33] =75 , [34] =86 , [35] =74 , [36] =75 , [37] =19 , [38] =54 , [39] =8, [42] = 14, } icons = { [0] = ":killmessages/icons/fist.png", [1] = ":killmessages/icons/brassknuckle.png", [2] = ":killmessages/icons/golfclub.png", [3] = ":killmessages/icons/nitestick.png", [4] = ":killmessages/icons/knifecur.png", [5] = ":killmessages/icons/bat.png", [6] = ":killmessages/icons/shovel.png", [7] = ":killmessages/icons/poolcue.png", [8] = ":killmessages/icons/katana.png", [9] = ":killmessages/icons/chnsaw.png", [10] = ":killmessages/icons/gun_dildo1.png", [11] = ":killmessages/icons/gun_dildo2.png", [12] = ":killmessages/icons/gun_vibe1.png", [14] = ":killmessages/icons/flowera.png", [15] = ":killmessages/icons/gun_cane.png", [16] = ":killmessages/icons/grenade.png", [17] = ":killmessages/icons/teargas.png", [18] = ":killmessages/icons/molotov.png", [19] = ":killmessages/icons/explosion.png", [22] = ":killmessages/icons/colt45.png", [23] = ":killmessages/icons/Silenced.png", [24] = ":killmessages/icons/desert_eagle.png", [25] = ":killmessages/icons/chromegun.png", [26] = ":killmessages/icons/sawnoff.png", [27] = ":killmessages/icons/shotgspa.png", [28] = ":killmessages/icons/micro_uzi.png", [29] = ":killmessages/icons/mp5lng.png", [30] = ":killmessages/icons/ak47.png", [31] = ":killmessages/icons/m4.png", [32] = ":killmessages/icons/tec9.png", [33] = ":killmessages/icons/cuntgun.png", [34] = ":killmessages/icons/sniper.png", [35] = ":killmessages/icons/rocketla.png", [36] = ":killmessages/icons/heatseek.png", [37] = ":killmessages/icons/flame.png", [38] = ":killmessages/icons/minigun.png", [39] = ":killmessages/icons/satchel.png", [42] = ":killmessages/icons/fireextinguisher.png", }; classGroups = { }; classesInfo = { }; classesWeapons = { }; classesSkins = { }; addEventHandler( "onClientResourceStart", getResourceRootElement(), function ( ) fadeCamera( true ); setTimer( setCameraMatrix, 50, 1, 1967.71, 1342.9, 26.63, 2034.47, 1343.02, 20.01 ); --letterBox.flyIn( ); preloadClassesInfo( ); createClassSelectionWnd( ); createGroupSelectionWnd( ); createClassDescriptionWnd( ); createClassWeaponWnd( ); --setTimer( createTempPed, 100, 1 ); showCursor( true ); showSpawnMenu( false, true ); --showHUDComponents( allHUDElements ); end ); function createTempPed( model ) -- 7474 - object id -- 8661 local x, y, z = getWorldFromScreenPosition( screenSize[ 1 ] - gridList:Size(false) / 2 - 70, ( screenSize[ 2 ]/2) --[[/ 1.6 ) * .8]], 10 ); local cX, cY, cZ = getCameraMatrix( ); x, y, z = getWorldFromScreenPosition( screenSize[ 1 ] - gridList:Size(false) / 2 - 70, ( screenSize[ 2 ]/2 )--[[ / 1.6 ) * .8]], 10 ) g_ground = createObject( 7474, x, y, z - 1.02, 0, 0, 90 ); tempPed = createPed( 0 and model or 0, x, y, z ); setPedRotation( tempPed, pedRot ); setElementFrozen( tempPed, true ); setPedAnimation( tempPed, "ped", "gang_gunstand ", -1, true, true, false ) --setPedAnimation( tempPed, "cop_ambient", "Coplook_nod", -1, true, true, false ) --setPedRotation( tempPed, 90 ); setElementAlpha( g_ground, 0 ); setTempPedRotating( true ); end function destroyTempPed( ) if tempPed then destroyElement( g_ground ); destroyElement( tempPed ); g_ground = nil; tempPed = nil; end end function setTempPedRotating( rotate ) if ( ( rotate ) and ( not pedRotating ) ) then addEventHandler( "onClientRender", g_root, rotatePed ); pedRotating = true; elseif ( not rotate ) then removeEventHandler( "onClientRender", g_root, rotatePed ); pedRotating = nil; end end function rotatePed( ) if tempPed then pedRot = pedRot + 1; setPedRotation( tempPed, pedRot ); end end function preloadClassesInfo( ) local groups = getElementsByType( "category" ); for _, group in ipairs( groups ) do table.insert( classGroups, Group:New( group ) ); end end function hideHUDComponents( components ) for i, comp in pairs( components ) do showPlayerHudComponent( comp, false ); end --showChat( false ); end function showHUDComponents( components ) for i, comp in pairs( components ) do showPlayerHudComponent( comp, true ); end --showChat( true ); end --addEventHandler( "onClientRender", getRootElement(), function animateLetterBox_flyIn ( ) if letterBox.animStartTick == 0 then letterBox.animStartTick = getTickCount(); letterBox.animFinishTick = letterBox.animStartTick + letterBox.animLength * 1000; letterBox.keepAnimating = true; end local stripH; local currentStripHeight = letterBox.stripHeight; if letterBox.keepAnimating then local currentTick = getTickCount(); local percentage = ( ( letterBox.animLength * 1000 ) - ( letterBox.animFinishTick - currentTick ) ) / ( letterBox.animLength * 1000 ); currentStripHeight = letterBox.stripHeight * percentage; if currentStripHeight > letterBox.stripHeight then currentStripHeight = letterBox.stripHeight; letterBox.keepAnimating = false; end
-
I had lots of FPS problems, tell me how old is your computer? Have you ever cleaned the dust out of it? I did it and it incresed my FPS and the cooler doesn't do anymore noise.
-
Already did that. SOLVED MY PROBLEM!! Opened my computer and cleaned the dust of the cooler and other pieces. Now i get about 60-90 FPS! EPIC INCRESE!
-
Ok, will do it, Thanks alot for your time and help.
-
TOP Secret. Damn! Government Scripts?
-
Good luck with it, CIT took a lot of time and pacience to be what it is Today.
-
Awesome. I'll definitely take a look at it. Thanks.
-
That's an amazing Resource/Script, will use it and have a laught with my friends! Thanks.
-
But it's the same, but my drops/spikes are bigger. - Edit: What about the "Streaming Memory" i have seen "fixes" around but i never tried them because they could be outdated.
-
Almost every single time, some times it's doesn't for a while then it comes back. I would record but i don't have "fraps" installed at the momment, so i found this video on another topic that you were commenting too, it is very similar some times it's a fast drop and sometimes it takes time to get back.
-
About 10-15 Minutes and then i get the lag spikes.
-
Yes, even on my own server, which didn't happen when i used to play on 1.2.
-
Here is the screenshot http://img859.imageshack.us/img859/6352 ... 224446.png I was getting 20-35 FPS and then it went to 4 FPS. Sometimes when i get those Lag Spikes the sounds goes weird too.
-
Installed the Drivers you mentioned and here is the log http://pastebin.com/CZAcyfXn
