Jump to content

GP-DayZ Shop Problem


shoBy

Recommended Posts

Hi guys...I have a problem to the shop plugin...

Error:

err.png

Script:

  
function BuyWeaponOnServer(weapon_name,data,value)
    player_money  = getPlayerMoney(source)
        if(weapon_name == "weapon_CZ550") then
            if ( player_money >= 1000) then
                setElementData(source,"CZ 550",getElementData(source,"CZ 550") + 1)
                setElementData(source,"CZ 550 Mag",getElementData(source,"CZ 550 Mag") + 25)
                takePlayerMoney(source, 1000)
                outputChatBox("#FF0000[sHOP] #FFFFFFSuccesfully bought!", source, 255, 255, 255 , true)
            else
                outputChatBox("#FF0000[sHOP] #FFFFFFYou don't have enough money!", source, 255, 255, 255 , true)
end
end
        if(weapon_name == "weapon_DesertEagle") then
              if ( player_money >= 300) then
                setElementData(source,"Desert Eagle",getElementData(source,"Desert Eagle") + 1)
                setElementData(source,"Desert Eagle Mag",getElementData(source,"Desert Eagle Mag") + 35)
                takePlayerMoney(source, 300)
                outputChatBox("#FF0000[sHOP] #FFFFFFSuccesfully bought!", source, 255, 255, 255 , true)
            else
                outputChatBox("#FF0000[sHOP] #FFFFFFYou don't have enough money!", source, 255, 255, 255 , true)
            end
    end
            if(weapon_name == "weapon_Granada") then
              if ( player_money >= 500) then
                setElementData(source,"Grenade",getElementData(source,"Grenade") + 1)
                takePlayerMoney(source, 500)
                outputChatBox("#FF0000[sHOP] #FFFFFFSuccesfully bought!", source, 255, 255, 255 , true)
            else
                outputChatBox("#FF0000[sHOP] #FFFFFFYou don't have enough money!", source, 255, 255, 255 , true)
            end
    end
                if(weapon_name == "weapon_M4") then
              if ( player_money >= 800) then
                setElementData(source,"M4",getElementData(source,"M4") + 1)
                setElementData(source,"M4 Mag",getElementData(source,"M4 Mag") + 60)
                takePlayerMoney(source, 800)
                outputChatBox("#FF0000[sHOP] #FFFFFFSuccesfully bought!", source, 255, 255, 255 , true)
            else
                outputChatBox("#FF0000[sHOP] #FFFFFFYou don't have enough money!", source, 255, 255, 255 , true)
            end
    end
            if(weapon_name == "weapon_AK47") then
              if ( player_money >= 700) then
                setElementData(source, "AK-47",getElementData(source,"M4") + 1)
                setElementData(source,"AK Mag",getElementData(source,"M4 Mag") + 120)
                takePlayerMoney(source, 700)
                outputChatBox("#FF0000[sHOP] #FFFFFFSuccesfully bought!", source, 255, 255, 255 , true)
            else
                outputChatBox("#FF0000[sHOP] #FFFFFFYou don't have enough money!", source, 255, 255, 255 , true)
            end
    end
                if(weapon_name == "weapon_M9SD") then
              if ( player_money >= 500) then
                setElementData(source, "M9 SD",getElementData(source,"M4") + 1)
                setElementData(source,"M9 SD Mag",getElementData(source,"M4 Mag") + 75)
                takePlayerMoney(source, 500)
                outputChatBox("#FF0000[sHOP] #FFFFFFSuccesfully bought!", source, 255, 255, 255 , true)
            else
                outputChatBox("#FF0000[sHOP] #FFFFFFYou don't have enough money!", source, 255, 255, 255 , true)
            end
    end
end
 
addEvent("onClientBuyWeapon", true)
addEventHandler("onClientBuyWeapon", getRootElement(), BuyWeaponOnServer)
 
 
--- Comida
 
 
function BuyWeaponOnServer(food_name,data,value)
    player_money      = getPlayerMoney(source)
 
        if(food_name == "Comida_Pizza") then
            if ( player_money >= 30) then
                setElementData(source, "Pizza",getElementData(source,"Pizza") + 5)
                takePlayerMoney(source, 30)
                outputChatBox("#FF0000[sHOP] #FFFFFFSuccesfully bought!", source, 255, 255, 255 , true)
            else
                outputChatBox("#FF0000[sHOP] #FFFFFFYou don't have enough money!", source, 255, 255, 255 , true)
end
end
        if(food_name == "Comida_Milk") then
              if ( player_money >= 30) then
                setElementData(source, "Milk",getElementData(source,"Milk") + 5)
                takePlayerMoney(source, 30)
                outputChatBox("#FF0000[sHOP] #FFFFFFSuccesfully bought!", source, 255, 255, 255 , true)
            else
                outputChatBox("#FF0000[sHOP] #FFFFFFYou don't have enough money!", source, 255, 255, 255 , true)
            end
    end
            if(food_name == "Comida_Cooked") then
              if ( player_money >= 60) then
                setElementData(source, "Cooked Meat",getElementData(source,"Cooked Meat") + 5)
                takePlayerMoney(source, 60)
                outputChatBox("#FF0000[sHOP] #FFFFFFSuccesfully bought!", source, 255, 255, 255 , true)
            else
                outputChatBox("#FF0000[sHOP] #FFFFFFYou don't have enough money!", source, 255, 255, 255 , true)
            end
    end
                if(food_name == "Comida_Soda") then
              if ( player_money >= 50) then
                setElementData(source, "Soda Bottle",getElementData(source,"Soda Bottle") + 5)
                takePlayerMoney(source, 50)
                outputChatBox("#FF0000[sHOP] #FFFFFFSuccesfully bought!", source, 255, 255, 255 , true)
            else
                outputChatBox("#FF0000[sHOP] #FFFFFFYou don't have enough money!", source, 255, 255, 255 , true)
            end
    end
            if(food_name == "Comida_BeansCan") then
              if ( player_money >= 40) then
                setElementData(source, "Beans Can",getElementData(source,"Beans Can") + 4)
                takePlayerMoney(source, 40)
                outputChatBox("#FF0000[sHOP] #FFFFFFSuccesfully bought!", source, 255, 255, 255 , true)
            else
                outputChatBox("#FF0000[sHOP] #FFFFFFYou don't have enough money!", source, 255, 255, 255 , true)
            end
    end
                if(food_name == "Comida_WaterBottle") then
              if ( player_money >= 50) then
                setElementData(source, "Water Bottle",getElementData(source,"Water Bottle") + 5)
                takePlayerMoney(source, 50)
                outputChatBox("#FF0000[sHOP] #FFFFFFSuccesfully bought!", source, 255, 255, 255 , true)
            else
                outputChatBox("#FF0000[sHOP] #FFFFFFYou don't have enough money!", source, 255, 255, 255 , true)
            end
    end
end
 
addEvent("onClientBuyComida", true)
addEventHandler("onClientBuyComida", getRootElement(), BuyWeaponOnServer)
 
 
--- Outros
 
function BuyWeaponOnServer(outros_name,data,value)
    player_money      = getPlayerMoney(source)
 
        if(outros_name == "Outro_Alice") then
              if ( player_money >= 300) then
                setElementData(source, "MAX_Slots" , 22 )
                takePlayerMoney(source, 300)
                outputChatBox("#FF0000[sHOP] #FFFFFFSuccesfully bought!", source, 255, 255, 255 , true)
            else
                outputChatBox("#FF0000[sHOP] #FFFFFFYou don't have enough money!", source, 255, 255, 255 , true)
            end
    end
            if(outros_name == "Outro_Road") then
              if ( player_money >= 10) then
                setElementData(source, "Roadflare",getElementData(source,"Roadflare") + 1)
                takePlayerMoney(source, 10)
                outputChatBox("#FF0000[sHOP] #FFFFFFSuccesfully bought!", source, 255, 255, 255 , true)
            else
                outputChatBox("#FF0000[sHOP] #FFFFFFYou don't have enough money!", source, 255, 255, 255 , true)
            end
    end
                if(outros_name == "Outro_Wire") then
              if ( player_money >= 50) then
                setElementData(source, "Wire Fence",getElementData(source,"Wire Fence") + 1)
                takePlayerMoney(source, 50)
                outputChatBox("#FF0000[sHOP] #FFFFFFSuccesfully bought!", source, 255, 255, 255 , true)
            else
                outputChatBox("#FF0000[sHOP] #FFFFFFYou don't have enough money!", source, 255, 255, 255 , true)
            end
    end
            if(outros_name == "Outro_Czech") then
              if ( player_money >= 600) then
                setElementData(source, "MAX_Slots" , 30 )
                takePlayerMoney(source, 600)
                outputChatBox("#FF0000[sHOP] #FFFFFFSuccesfully bought!", source, 255, 255, 255 , true)
            else
                outputChatBox("#FF0000[sHOP] #FFFFFFYou don't have enough money!", source, 255, 255, 255 , true)
            end
    end
                if(outros_name == "Outro_Full") then
              if ( player_money >= 300) then
                setElementData(source, "Full Gas Canister",getElementData(source,"Full Gas Canister") + 2)
                takePlayerMoney(source, 300)
                outputChatBox("#FF0000[sHOP] #FFFFFFSuccesfully bought!", source, 255, 255, 255 , true)
            else
                outputChatBox("#FF0000[sHOP] #FFFFFFYou don't have enough money!", source, 255, 255, 255 , true)
            end
    end
end
 
addEvent("onClientBuyOutros", true)
addEventHandler("onClientBuyOutros", getRootElement(), BuyWeaponOnServer)
 
 
--- Municao
 
function BuyWeaponOnServer(municao_name,data,value)
    player_money      = getPlayerMoney(source)
 
        if(municao_name == "Municao_CZ550Mag") then
            if ( player_money >= 500) then
                setElementData(source, "CZ 550 Mag",getElementData(source,"CZ 550 Mag") + 25)
                takePlayerMoney(source, 500)
                outputChatBox("#FF0000[sHOP] #FFFFFFSuccesfully bought!", source, 255, 255, 255 , true)
            else
                outputChatBox("#FF0000[sHOP] #FFFFFFYou don't have enough money!", source, 255, 255, 255 , true)
end
end
        if(municao_name == "Municao_MP5Mag") then
              if ( player_money >= 100) then
                setElementData(source, "MP5A5 Mag",getElementData(source,"MP5A5 Mag") + 60)
                takePlayerMoney(source, 100)
                outputChatBox("#FF0000[sHOP] #FFFFFFSuccesfully bought!", source, 255, 255, 255 , true)
            else
                outputChatBox("#FF0000[sHOP] #FFFFFFYou don't have enough money!", source, 255, 255, 255 , true)
            end
    end
            if(municao_name == "Municao_PDWMag") then
              if ( player_money >= 200) then
                setElementData(source, "PDW Mag",getElementData(source,"PDW Mag") + 60)
                takePlayerMoney(source, 200)
                outputChatBox("#FF0000[sHOP] #FFFFFFSuccesfully bought!", source, 255, 255, 255 , true)
            else
                outputChatBox("#FF0000[sHOP] #FFFFFFYou don't have enough money!", source, 255, 255, 255 , true)
            end
    end
                if(municao_name == "Municao_WinchesterMAG") then
              if ( player_money >= 200) then
                setElementData(source, "1866 Slug",getElementData(source,"1866 Slug") + 21)
                takePlayerMoney(source, 200)
                outputChatBox("#FF0000[sHOP] #FFFFFFSuccesfully bought!", source, 255, 255, 255 , true)
            else
                outputChatBox("#FF0000[sHOP] #FFFFFFYou don't have enough money!", source, 255, 255, 255 , true)
            end
    end
            if(municao_name == "Municao_AKMag") then
              if ( player_money >= 400) then
                setElementData(source, "AK Mag",getElementData(source,"AK Mag") + 90)
                takePlayerMoney(source, 400)
                outputChatBox("#FF0000[sHOP] #FFFFFFSuccesfully bought!", source, 255, 255, 255 , true)
            else
                outputChatBox("#FF0000[sHOP] #FFFFFFYou don't have enough money!", source, 255, 255, 255 , true)
            end
    end
                if(municao_name == "Municao_M4Mag") then
              if ( player_money >= 500) then
                setElementData(source, "M4 Mag",getElementData(source,"M4 Mag") + 80)
                takePlayerMoney(source, 500)
                outputChatBox("#FF0000[sHOP] #FFFFFFSuccesfully bought!", source, 255, 255, 255 , true)
            else
                outputChatBox("#FF0000[sHOP] #FFFFFFYou don't have enough money!", source, 255, 255, 255 , true)
            end
    end
end
addEvent("onClientBuyMunicao", true)
addEventHandler("onClientBuyMunicao", getRootElement(), BuyWeaponOnServer)
Link to comment

Where you created these markers? they aren't in the script?

  
------------- OPen 
function AbrirJanela1(hitPlayer) 
triggerClientEvent (hitPlayer,"openWindow",getRootElement(),hitPlayer) 
end 
addEventHandler("onMarkerHit",marker,AbrirJanela1) 
  
function AbrirJanela1(hitPlayer) 
triggerClientEvent (hitPlayer,"openWindow",getRootElement(),hitPlayer) 
end 
addEventHandler("onMarkerHit",marker1,AbrirJanela1) 
function AbrirJanela1(hitPlayer) 
triggerClientEvent (hitPlayer,"openWindow",getRootElement(),hitPlayer) 
end 
addEventHandler("onMarkerHit",marker2,AbrirJanela1) 
function AbrirJanela1(hitPlayer) 
triggerClientEvent (hitPlayer,"openWindow",getRootElement(),hitPlayer) 
end 
addEventHandler("onMarkerHit",marker3,AbrirJanela1) 
function AbrirJanela1(hitPlayer) 
triggerClientEvent (hitPlayer,"openWindow",getRootElement(),hitPlayer) 
end 
addEventHandler("onMarkerHit",marker4,AbrirJanela1) 
function AbrirJanela1(hitPlayer) 
triggerClientEvent (hitPlayer,"openWindow",getRootElement(),hitPlayer) 
end 
addEventHandler("onMarkerHit",marker5,AbrirJanela1) 
function AbrirJanela1(hitPlayer) 
triggerClientEvent (hitPlayer,"openWindow",getRootElement(),hitPlayer) 
end 
addEventHandler("onMarkerHit",marker6,AbrirJanela1) 
function AbrirJanela1(hitPlayer) 
triggerClientEvent (hitPlayer,"openWindow",getRootElement(),hitPlayer) 
end 
addEventHandler("onMarkerHit",marker7,AbrirJanela1) 
function AbrirJanela1(hitPlayer) 
triggerClientEvent (hitPlayer,"openWindow",getRootElement(),hitPlayer) 
end 
addEventHandler("onMarkerHit",marker8,AbrirJanela1) 
function AbrirJanela1(hitPlayer) 
triggerClientEvent (hitPlayer,"openWindow",getRootElement(),hitPlayer) 
end 
addEventHandler("onMarkerHit",marker9,AbrirJanela1) 
function AbrirJanela1(hitPlayer) 
triggerClientEvent (hitPlayer,"openWindow",getRootElement(),hitPlayer) 
end 
addEventHandler("onMarkerHit",marker10,AbrirJanela1) 
function AbrirJanela1(hitPlayer) 
triggerClientEvent (hitPlayer,"openWindow",getRootElement(),hitPlayer) 
end 
addEventHandler("onMarkerHit",marker11,AbrirJanela1) 
  
function AbrirJanela12(hitPlayer) 
triggerClientEvent (hitPlayer,"openWindow",getRootElement(),hitPlayer) 
end 
addEventHandler("onMarkerHit",marker12,AbrirJanela12) 
  
function AbrirJanela1(hitPlayer) 
triggerClientEvent (hitPlayer,"openWindow",getRootElement(),hitPlayer) 
end 
addEventHandler("onMarkerHit",marker13,AbrirJanela1) 
function AbrirJanela1(hitPlayer) 
triggerClientEvent (hitPlayer,"openWindow",getRootElement(),hitPlayer) 
end 
addEventHandler("onMarkerHit",marker14,AbrirJanela1) 
  
function AbrirJanela1(hitPlayer) 
triggerClientEvent (hitPlayer,"openWindow",getRootElement(),hitPlayer) 
end 
addEventHandler("onMarkerHit",marker15,AbrirJanela1) 
  
function AbrirJanela1(hitPlayer) 
triggerClientEvent (hitPlayer,"openWindow",getRootElement(),hitPlayer) 
end 
addEventHandler("onMarkerHit",marker16,AbrirJanela1) 
  
function AbrirJanela1(hitPlayer) 
triggerClientEvent (hitPlayer,"openWindow",getRootElement(),hitPlayer) 
end 
addEventHandler("onMarkerHit",marker17,AbrirJanela1) 

Link to comment
  
 
function BuyWeaponOnServer(weapon_name,data,value)
    player_money  = getPlayerMoney(source)
        if(weapon_name == "weapon_CZ550") then
            if ( player_money >= 1000) then
                setElementData(source,"CZ 550",getElementData(source,"CZ 550") + 1)
                setElementData(source,"CZ 550 Mag",getElementData(source,"CZ 550 Mag") + 25)
                takePlayerMoney(source, 1000)
                outputChatBox("#FF0000[sHOP] #FFFFFFSuccesfully bought!", source, 255, 255, 255 , true)
            else
                outputChatBox("#FF0000[sHOP] #FFFFFFYou don't have enough money!", source, 255, 255, 255 , true)
end
end
        if(weapon_name == "weapon_DesertEagle") then
              if ( player_money >= 300) then
                setElementData(source,"Desert Eagle",getElementData(source,"Desert Eagle") + 1)
                setElementData(source,"Desert Eagle Mag",getElementData(source,"Desert Eagle Mag") + 35)
                takePlayerMoney(source, 300)
                outputChatBox("#FF0000[sHOP] #FFFFFFSuccesfully bought!", source, 255, 255, 255 , true)
            else
                outputChatBox("#FF0000[sHOP] #FFFFFFYou don't have enough money!", source, 255, 255, 255 , true)
            end
    end
            if(weapon_name == "weapon_Granada") then
              if ( player_money >= 500) then
                setElementData(source,"Grenade",getElementData(source,"Grenade") + 1)
                takePlayerMoney(source, 500)
                outputChatBox("#FF0000[sHOP] #FFFFFFSuccesfully bought!", source, 255, 255, 255 , true)
            else
                outputChatBox("#FF0000[sHOP] #FFFFFFYou don't have enough money!", source, 255, 255, 255 , true)
            end
    end
                if(weapon_name == "weapon_M4") then
              if ( player_money >= 800) then
                setElementData(source,"M4",getElementData(source,"M4") + 1)
                setElementData(source,"M4 Mag",getElementData(source,"M4 Mag") + 60)
                takePlayerMoney(source, 800)
                outputChatBox("#FF0000[sHOP] #FFFFFFSuccesfully bought!", source, 255, 255, 255 , true)
            else
                outputChatBox("#FF0000[sHOP] #FFFFFFYou don't have enough money!", source, 255, 255, 255 , true)
            end
    end
            if(weapon_name == "weapon_AK47") then
              if ( player_money >= 700) then
                setElementData(source, "AK-47",getElementData(source,"M4") + 1)
                setElementData(source,"AK Mag",getElementData(source,"M4 Mag") + 120)
                takePlayerMoney(source, 700)
                outputChatBox("#FF0000[sHOP] #FFFFFFSuccesfully bought!", source, 255, 255, 255 , true)
            else
                outputChatBox("#FF0000[sHOP] #FFFFFFYou don't have enough money!", source, 255, 255, 255 , true)
            end
    end
                if(weapon_name == "weapon_M9SD") then
              if ( player_money >= 500) then
                setElementData(source, "M9 SD",getElementData(source,"M4") + 1)
                setElementData(source,"M9 SD Mag",getElementData(source,"M4 Mag") + 75)
                takePlayerMoney(source, 500)
                outputChatBox("#FF0000[sHOP] #FFFFFFSuccesfully bought!", source, 255, 255, 255 , true)
            else
                outputChatBox("#FF0000[sHOP] #FFFFFFYou don't have enough money!", source, 255, 255, 255 , true)
            end
    end
end
 
addEvent("onClientBuyWeapon", true)
addEventHandler("onClientBuyWeapon", getRootElement(), BuyWeaponOnServer)
 
 
--- Comida
 
 
function BuyWeaponOnServer(food_name,data,value)
    player_money      = getPlayerMoney(source)
 
        if(food_name == "Comida_Pizza") then
            if ( player_money >= 30) then
                setElementData(source, "Pizza",getElementData(source,"Pizza") + 5)
                takePlayerMoney(source, 30)
                outputChatBox("#FF0000[sHOP] #FFFFFFSuccesfully bought!", source, 255, 255, 255 , true)
            else
                outputChatBox("#FF0000[sHOP] #FFFFFFYou don't have enough money!", source, 255, 255, 255 , true)
end
end
        if(food_name == "Comida_Milk") then
              if ( player_money >= 30) then
                setElementData(source, "Milk",getElementData(source,"Milk") + 5)
                takePlayerMoney(source, 30)
                outputChatBox("#FF0000[sHOP] #FFFFFFSuccesfully bought!", source, 255, 255, 255 , true)
            else
                outputChatBox("#FF0000[sHOP] #FFFFFFYou don't have enough money!", source, 255, 255, 255 , true)
            end
    end
            if(food_name == "Comida_Cooked") then
              if ( player_money >= 60) then
                setElementData(source, "Cooked Meat",getElementData(source,"Cooked Meat") + 5)
                takePlayerMoney(source, 60)
                outputChatBox("#FF0000[sHOP] #FFFFFFSuccesfully bought!", source, 255, 255, 255 , true)
            else
                outputChatBox("#FF0000[sHOP] #FFFFFFYou don't have enough money!", source, 255, 255, 255 , true)
            end
    end
                if(food_name == "Comida_Soda") then
              if ( player_money >= 50) then
                setElementData(source, "Soda Bottle",getElementData(source,"Soda Bottle") + 5)
                takePlayerMoney(source, 50)
                outputChatBox("#FF0000[sHOP] #FFFFFFSuccesfully bought!", source, 255, 255, 255 , true)
            else
                outputChatBox("#FF0000[sHOP] #FFFFFFYou don't have enough money!", source, 255, 255, 255 , true)
            end
    end
            if(food_name == "Comida_BeansCan") then
              if ( player_money >= 40) then
                setElementData(source, "Beans Can",getElementData(source,"Beans Can") + 4)
                takePlayerMoney(source, 40)
                outputChatBox("#FF0000[sHOP] #FFFFFFSuccesfully bought!", source, 255, 255, 255 , true)
            else
                outputChatBox("#FF0000[sHOP] #FFFFFFYou don't have enough money!", source, 255, 255, 255 , true)
            end
    end
                if(food_name == "Comida_WaterBottle") then
              if ( player_money >= 50) then
                setElementData(source, "Water Bottle",getElementData(source,"Water Bottle") + 5)
                takePlayerMoney(source, 50)
                outputChatBox("#FF0000[sHOP] #FFFFFFSuccesfully bought!", source, 255, 255, 255 , true)
            else
                outputChatBox("#FF0000[sHOP] #FFFFFFYou don't have enough money!", source, 255, 255, 255 , true)
            end
    end
end
 
addEvent("onClientBuyComida", true)
addEventHandler("onClientBuyComida", getRootElement(), BuyWeaponOnServer)
 
 
--- Outros
 
function BuyWeaponOnServer(outros_name,data,value)
    player_money      = getPlayerMoney(source)
 
        if(outros_name == "Outro_Alice") then
              if ( player_money >= 300) then
                setElementData(source, "MAX_Slots" , 22 )
                takePlayerMoney(source, 300)
                outputChatBox("#FF0000[sHOP] #FFFFFFSuccesfully bought!", source, 255, 255, 255 , true)
            else
                outputChatBox("#FF0000[sHOP] #FFFFFFYou don't have enough money!", source, 255, 255, 255 , true)
            end
    end
            if(outros_name == "Outro_Road") then
              if ( player_money >= 10) then
                setElementData(source, "Roadflare",getElementData(source,"Roadflare") + 1)
                takePlayerMoney(source, 10)
                outputChatBox("#FF0000[sHOP] #FFFFFFSuccesfully bought!", source, 255, 255, 255 , true)
            else
                outputChatBox("#FF0000[sHOP] #FFFFFFYou don't have enough money!", source, 255, 255, 255 , true)
            end
    end
                if(outros_name == "Outro_Wire") then
              if ( player_money >= 50) then
                setElementData(source, "Wire Fence",getElementData(source,"Wire Fence") + 1)
                takePlayerMoney(source, 50)
                outputChatBox("#FF0000[sHOP] #FFFFFFSuccesfully bought!", source, 255, 255, 255 , true)
            else
                outputChatBox("#FF0000[sHOP] #FFFFFFYou don't have enough money!", source, 255, 255, 255 , true)
            end
    end
            if(outros_name == "Outro_Czech") then
              if ( player_money >= 600) then
                setElementData(source, "MAX_Slots" , 30 )
                takePlayerMoney(source, 600)
                outputChatBox("#FF0000[sHOP] #FFFFFFSuccesfully bought!", source, 255, 255, 255 , true)
            else
                outputChatBox("#FF0000[sHOP] #FFFFFFYou don't have enough money!", source, 255, 255, 255 , true)
            end
    end
                if(outros_name == "Outro_Full") then
              if ( player_money >= 300) then
                setElementData(source, "Full Gas Canister",getElementData(source,"Full Gas Canister") + 2)
                takePlayerMoney(source, 300)
                outputChatBox("#FF0000[sHOP] #FFFFFFSuccesfully bought!", source, 255, 255, 255 , true)
            else
                outputChatBox("#FF0000[sHOP] #FFFFFFYou don't have enough money!", source, 255, 255, 255 , true)
            end
    end
end
 
addEvent("onClientBuyOutros", true)
addEventHandler("onClientBuyOutros", getRootElement(), BuyWeaponOnServer)
 
 
--- Municao
 
function BuyWeaponOnServer(municao_name,data,value)
    player_money      = getPlayerMoney(source)
 
        if(municao_name == "Municao_CZ550Mag") then
            if ( player_money >= 500) then
                setElementData(source, "CZ 550 Mag",getElementData(source,"CZ 550 Mag") + 25)
                takePlayerMoney(source, 500)
                outputChatBox("#FF0000[sHOP] #FFFFFFSuccesfully bought!", source, 255, 255, 255 , true)
            else
                outputChatBox("#FF0000[sHOP] #FFFFFFYou don't have enough money!", source, 255, 255, 255 , true)
end
end
        if(municao_name == "Municao_MP5Mag") then
              if ( player_money >= 100) then
                setElementData(source, "MP5A5 Mag",getElementData(source,"MP5A5 Mag") + 60)
                takePlayerMoney(source, 100)
                outputChatBox("#FF0000[sHOP] #FFFFFFSuccesfully bought!", source, 255, 255, 255 , true)
            else
                outputChatBox("#FF0000[sHOP] #FFFFFFYou don't have enough money!", source, 255, 255, 255 , true)
            end
    end
            if(municao_name == "Municao_PDWMag") then
              if ( player_money >= 200) then
                setElementData(source, "PDW Mag",getElementData(source,"PDW Mag") + 60)
                takePlayerMoney(source, 200)
                outputChatBox("#FF0000[sHOP] #FFFFFFSuccesfully bought!", source, 255, 255, 255 , true)
            else
                outputChatBox("#FF0000[sHOP] #FFFFFFYou don't have enough money!", source, 255, 255, 255 , true)
            end
    end
                if(municao_name == "Municao_WinchesterMAG") then
              if ( player_money >= 200) then
                setElementData(source, "1866 Slug",getElementData(source,"1866 Slug") + 21)
                takePlayerMoney(source, 200)
                outputChatBox("#FF0000[sHOP] #FFFFFFSuccesfully bought!", source, 255, 255, 255 , true)
            else
                outputChatBox("#FF0000[sHOP] #FFFFFFYou don't have enough money!", source, 255, 255, 255 , true)
            end
    end
            if(municao_name == "Municao_AKMag") then
              if ( player_money >= 400) then
                setElementData(source, "AK Mag",getElementData(source,"AK Mag") + 90)
                takePlayerMoney(source, 400)
                outputChatBox("#FF0000[sHOP] #FFFFFFSuccesfully bought!", source, 255, 255, 255 , true)
            else
                outputChatBox("#FF0000[sHOP] #FFFFFFYou don't have enough money!", source, 255, 255, 255 , true)
            end
    end
                if(municao_name == "Municao_M4Mag") then
              if ( player_money >= 500) then
                setElementData(source, "M4 Mag",getElementData(source,"M4 Mag") + 80)
                takePlayerMoney(source, 500)
                outputChatBox("#FF0000[sHOP] #FFFFFFSuccesfully bought!", source, 255, 255, 255 , true)
            else
                outputChatBox("#FF0000[sHOP] #FFFFFFYou don't have enough money!", source, 255, 255, 255 , true)
            end
    end
end
Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...