AHA!! Understand now gonna try and tell you..thanks
look changed it and got another problem but fixed too..everything's fixed now but there's another error but not shown anything in CMD window..with when i buy UZI weapon works..but when i buy the ammo for it..it tells me the message
"i think you forgot to buy UZI first"
but i bought it already...Another weapons're Working good normal with buy gun and buy ammo..This scripts after i fixed
Server Side:
marcadorTienda = createMarker(2285.8000488281,549.59997558594,6.8000001907349,"cylinder",1.5,0,125,250,153)
function mostrarTienda(hitPlayer)
triggerClientEvent(hitPlayer,"mostrarTienda",getRootElement(),hitPlayer)
end
addEventHandler("onMarkerHit",marcadorTienda,mostrarTienda)
addEvent ("comprocolt_45", true)
addEventHandler ("comprocolt_45", getRootElement(),
function (id, cost,munic)
if (getPlayerMoney (source) >= tonumber(cost)) then
outputChatBox ("Congratulations!,You Bought a colt", source, 0, 255, 0, false)
takePlayerMoney (source, tonumber (cost))
giveWeapon(source, tonumber (id),tonumber (munic))
else
outputChatBox ("No money? Go kill some Zombies", source, 255, 0, 0, false)
end
end)
addEvent ("comproShotgun", true)
addEventHandler ("comproShotgun", getRootElement(),
function (id, cost,munic)
if (getPlayerMoney (source) >= tonumber(cost)) then
outputChatBox ("Congratulations!,You bought a Shotgun", source, 0, 255, 0, false)
takePlayerMoney (source, tonumber (cost))
giveWeapon(source, tonumber (id),tonumber (munic))
else
outputChatBox ("No money? Go kill some Zombies", source, 255, 0, 0, false)
end
end)
addEvent ("comprotec_9", true)
addEventHandler ("comprotec_9", getRootElement(),
function (id, cost,munic)
if (getPlayerMoney (source) >= tonumber(cost)) then
outputChatBox ("Congratulations!,You bought a tec_9", source, 0, 255, 0, false)
takePlayerMoney (source, tonumber (cost))
giveWeapon(source, tonumber (id),tonumber (munic))
else
outputChatBox ("No money? Go kill some Zombies", source, 255, 0, 0, false)
end
end)
addEvent ("comproUZI", true)
addEventHandler ("comproUZI", getRootElement(),
function (id, cost,munic)
if (getPlayerMoney (source) >= tonumber(cost)) then
outputChatBox ("Congratulations!,You bought a UZI", source, 0, 255, 0, false)
takePlayerMoney (source, tonumber (cost))
giveWeapon(source, tonumber (id),tonumber (munic))
else
outputChatBox ("No money? Go kill some Zombies", source, 255, 0, 0, false)
end
end)
addEvent ("comproMunicionUZI", true)
addEventHandler ("comproMunicionUZI", getRootElement(),
function (id, cost,munic)
local tieneUZI = getPedWeapon(source,5)
if (getPlayerMoney (source) >= tonumber(cost)) and (tieneUZI == 28) then
outputChatBox ("Congratulations!,you bought a UZI ammo", source, 0, 255, 0, false)
takePlayerMoney (source, tonumber (cost))
giveWeapon(source,tonumber(id),tonumber(munic))
elseif (getPlayerMoney (source) >= tonumber(cost)) and (tieneUZI ~= 28) then
outputChatBox ("Ehm,I think you forgot to buy the UZI First -.-", source, 255, 0, 0, false)
elseif (getPlayerMoney (source) < tonumber(cost)) and (tieneUZI == 28) then
outputChatBox ("No money? Go kill some zombies", source, 255, 0, 0, false)
else
outputChatBox ("Ehm,I think you forgot to buy the UZI First -.-", source, 255, 0, 0, false)
end
end)
addEvent ("comproMuniciontec_9", true)
addEventHandler ("comproMuniciontec_9", getRootElement(),
function (id, cost,munic)
local tienetec_9 = getPedWeapon(source,4)
if (getPlayerMoney (source) >= tonumber(cost)) and (tienetec_9 == 32) then
outputChatBox ("Congratulations!,You bought a tec_9 Ammo", source, 0, 255, 0, false)
takePlayerMoney (source, tonumber (cost))
giveWeapon(source,tonumber(id),tonumber(munic))
elseif (getPlayerMoney (source) >= tonumber(cost)) and (tienetec_9 ~= 32) then
outputChatBox ("Ehm,I think you forgot to buy the tec_9 First -.-", source, 255, 0, 0, false)
elseif (getPlayerMoney (source) < tonumber(cost)) and (tienetec_9 == 32) then
outputChatBox ("No money? Go kill some zombies", source, 255, 0, 0, false)
else outputChatBox ("Ehm,I think you forgot to buy the tec_9 First -.-", source, 255, 0, 0, false)
end
end)
addEvent ("comproMunicionShotgun", true)
addEventHandler ("comproMunicionShotgun", getRootElement(),
function (id, cost,munic)
local tieneShotgun = getPedWeapon(source,3)
if (getPlayerMoney (source) >= tonumber(cost)) and (tieneShotgun == 25) then
outputChatBox ("Congratulations,You bought a shotgun ammo", source, 0, 255, 0, false)
takePlayerMoney (source, tonumber (cost))
giveWeapon(source,tonumber(id),tonumber(munic))
elseif (getPlayerMoney (source) >= tonumber(cost)) and (tieneShotgun ~= 25) then
outputChatBox ("Ehm,I think you forgot to buy the Shotgun First -.-", source, 255, 0, 0, false)
elseif (getPlayerMoney (source) < tonumber(cost)) and (tieneShotgun == 25) then
outputChatBox ("No money? Go kill some zombies.", source, 255, 0, 0, false)
else outputChatBox ("Ehm,I think you forgot to buy the Shotgun First -.-", source, 255, 0, 0, false)
end
end)
addEvent ("comproMunicioncolt_45", true)
addEventHandler ("comproMunicioncolt_45", getRootElement(),
function (id, cost,munic)
local tienecolt_45 = getPedWeapon(source,2)
if (getPlayerMoney (source) >= tonumber(cost)) and (tienecolt_45 == 22) then
outputChatBox ("Congartulations,You bought a Colt ammo", source, 0, 255, 0, false)
takePlayerMoney (source, tonumber (cost))
giveWeapon(source,tonumber(id),tonumber(munic))
elseif (getPlayerMoney (source) >= tonumber(cost)) and (tienecolt_45 ~= 22) then
outputChatBox ("Ehm,I think you forgot to buy the Colt First -.-", source, 255, 0, 0, false)
elseif (getPlayerMoney (source) < tonumber(cost)) and (tienecolt_45 == 22) then
outputChatBox ("No money? Go kill some zombies", source, 255, 0, 0, false)
else outputChatBox ("Ehm,I think you forgot to buy the Colt First -.-", source, 255, 0, 0, false)
end
end)
addEventHandler("onResourceStart",getRootElement(),
function ()
outputChatBox("Gunshop by LiOneLMeSsI")
end
)
Client Side:
GUIEditor_Image = {}
tiendaDeArmas2 = guiCreateWindow(181,168,456,318,"Gun Shop By:LiOneLMeSsI",false)
botonComprarcolt_45 = guiCreateButton(15,106,99,26,"Colt($100)",false,tiendaDeArmas2)
botonComprarShotgun = guiCreateButton(121,106,99,26,"Shotgun($500)",false,tiendaDeArmas2)
botonComprartec_9 = guiCreateButton(226,106,99,26,"tec_9($650)",false,tiendaDeArmas2)
botonComprarUZI = guiCreateButton(330,106,98,26,"UZI($700)",false,tiendaDeArmas2)
botonComprarMuniccolt_45 = guiCreateButton(11,234,105,26,"Ammo.x17($10)",false,tiendaDeArmas2)
botonComprarMunicUZI = guiCreateButton(336,234,105,26,"Ammo.x20($50)",false,tiendaDeArmas2)
botonComprarMunictec_9 = guiCreateButton(228,234,105,26,"Ammo.x30($40)",false,tiendaDeArmas2)
botonComprarMunicShotgun = guiCreateButton(120,234,105,26,"Ammo.x17($25)",false,tiendaDeArmas2)
munictec_9Img = guiCreateStaticImage(248,154,68,73,"images/53.png",false,tiendaDeArmas2)
municUZIImg = guiCreateStaticImage(356,155,62,70,"images/55.png",false,tiendaDeArmas2)
municcolt_45Img = guiCreateStaticImage(35,157,64,71,"images/51.png",false,tiendaDeArmas2)
municShotgunImg = guiCreateStaticImage(141,154,66,72,"images/52.png",false,tiendaDeArmas2)
imagecolt_45 = guiCreateStaticImage(35,38,63,61,"images/22.png",false,tiendaDeArmas2)
imageUZI = guiCreateStaticImage(342,36,64,62,"images/28.png",false,tiendaDeArmas2)
imagetec_9 = guiCreateStaticImage(242,34,65,65,"images/32.png",false,tiendaDeArmas2)
imageEscopeta = guiCreateStaticImage(138,37,65,62,"images/25.png",false,tiendaDeArmas2)
Salir = guiCreateButton(362,279,70,25,"Close",false,tiendaDeArmas2)
guiWindowSetMovable(tiendaDeArmas2,false)
guiWindowSetSizable(tiendaDeArmas2,false)
guiSetVisible(tiendaDeArmas2,false)
function mostrarTienda()
guiSetVisible (tiendaDeArmas2,true)
showCursor(true)
end
addEvent("mostrarTienda",true)
addEventHandler("mostrarTienda",getRootElement(),mostrarTienda)
function closeShop2()
if guiGetVisible(tiendaDeArmas2) then
guiSetVisible(tiendaDeArmas2,false)
showCursor(false)
end
end
addEventHandler ("onClientGUIClick", Salir, closeShop2)
function darcolt_45()
local itemID = 22
local itemCost = 100
local itemMunic = 1
triggerServerEvent ("comprocolt_45", getLocalPlayer(), itemID, itemCost,itemMunic)
end
addEventHandler ("onClientGUIClick", botonComprarcolt_45, darcolt_45)
function darShotgun()
local itemID = 25
local itemCost = 500
local itemMunic = 1
triggerServerEvent ("comproShotgun", getLocalPlayer(), itemID, itemCost,itemMunic)
end
addEventHandler ("onClientGUIClick", botonComprarShotgun, darShotgun)
function dartec_9()
local itemID = 32
local itemCost = 600
local itemMunic = 1
triggerServerEvent ("comprotec_9", getLocalPlayer(), itemID, itemCost,itemMunic)
end
addEventHandler ("onClientGUIClick", botonComprartec_9, dartec_9)
function darUZI()
local itemID = 28
local itemCost = 700
local itemMunic = 1
triggerServerEvent ("comproUZI", getLocalPlayer(), itemID, itemCost,itemMunic)
end
addEventHandler ("onClientGUIClick", botonComprarUZI, darUZI)
function darMunicUZI()
local armaID = 28
local itemCost = 50
local itemMunic = 30
triggerServerEvent ("comproMunicionUZI", getLocalPlayer(), armaID, itemCost,itemMunic)
end
addEventHandler ("onClientGUIClick", botonComprarMunicUZI, darMunicUZI)
function darMunictec_9()
local armaID = 32
local itemCost = 40
local itemMunic = 30
triggerServerEvent ("comproMuniciontec_9", getLocalPlayer(), armaID, itemCost,itemMunic)
end
addEventHandler ("onClientGUIClick", botonComprarMunictec_9, darMunictec_9)
function darMunicShotgun()
local armaID = 25
local itemCost = 25
local itemMunic = 17
triggerServerEvent ("comproMunicionShotgun", getLocalPlayer(), armaID, itemCost,itemMunic)
end
addEventHandler ("onClientGUIClick", botonComprarMunicShotgun, darMunicShotgun)
function darMuniccolt_45()
local armaID = 22
local itemCost = 10
local itemMunic = 17
triggerServerEvent ("comproMunicioncolt_45", getLocalPlayer(), armaID, itemCost,itemMunic)
end
addEventHandler ("onClientGUIClick", botonComprarMuniccolt_45, darMuniccolt_45)
Please help me with this ....and THanks a lot