Search the Community
Showing results for tags 'dayz dev'.
-
Olá, estou com um problema com um script que atualmente aceita elementdata como moeda. local currency_item = "zombieskilled"; if (guiGridListGetSelectedItem(shop_gui.gridlist[2] ) == -1) then guiSetText(shop_gui.label[4],"Please select an item") guiLabelSetColor (shop_gui.label[4],255,0,0) else if (shop_marker_type == "supply") then local target = localPlayer; local item = guiGridListGetItemText(shop_gui.gridlist[2], guiGridListGetSelectedItem(shop_gui.gridlist[2]),1) local amount,price,itemdata = unpack(guiGridListGetItemData(shop_gui.gridlist[2], guiGridListGetSelectedItem(shop_gui.gridlist[2]),2)) guiLabelSetColor(shop_gui.label[4],255,0,0) if (getElementData(localPlayer, currency_item) >= price) then guiSetText(shop_gui.label[4],"You successfully bought "..item..".") guiLabelSetColor (shop_gui.label[4],0,149,14,255) triggerServerEvent("DayZPH:onClientSuccessBuysItem",localPlayer,target,itemdata,currency_item,amount,price) else guiSetText(shop_gui.label[4],"You don't have enough money (PHP) to buy utilities") end elseif (shop_marker_type == "vehicle") then local target = localPlayer; local vehicleName = guiGridListGetItemText(shop_gui.gridlist[2], guiGridListGetSelectedItem(shop_gui.gridlist[2]),1) local id,engine,rotor,tires,tankparts,scrap,slots,fuel,price = unpack(guiGridListGetItemData(shop_gui.gridlist[2],guiGridListGetSelectedItem(shop_gui.gridlist[2]),1)) local x,y,z,rx,ry,rz = unpack(vehicle_spawn_position) guiLabelSetColor(shop_gui.label[4],255,0,0) if (getElementData(localPlayer,currency_item) >= price) then for i,v in ipairs(getElementsWithinColShape(vehicle_spawn_position_col[shop_marker],"vehicle")) do guiSetText(shop_gui.label[4],"Vehicle spawn area is taken, clear it before buying vehicle.") return end guiSetVisible(shop_gui.window[1],false) showCursor(false) outputChatBox("You successfully bought "..vehicleName..".",0,255,0) triggerServerEvent("DayZPH:onClientSuccessBuysVehicle",localPlayer,target,currency_item,price,x,y,z,rx,ry,rz,id,engine,rotor,tires,tankparts,scrap,slots,fuel) else guiSetText(shop_gui.label[4], "You don't have enough money (PHP) to buy a car") end end end server side function onClientSuccessBuysItem(target,item,currency,amount,price) setElementData(target,item,getElementData(target,item)+amount) setElementData(target,currency,getElementData(target,currency)-price) end addEvent("DayZPH:onClientSuccessBuysItem",true) addEventHandler("DayZPH:onClientSuccessBuysItem",getRootElement(),onClientSuccessBuysItem) addEventHandler("onPlayerLogin",root,function() triggerClientEvent(source,"load_shop",source); end); Eu tentei mudar a variável para currency_item = getPlayerMoney(source); mas não vejo isso funcionando. alguma coisa que estou perdendo? Por favor me ajude veja o código completo client server
-
مطلوب مبرمجين لتعديل سيرفرات الديزي وراح يمسكون رتبة بالسيرفر mtasa://37.59.235.24:22022 [WnAsH-Time]●[ وناسة تايم ]●[ سرفايفل ديزي ]●[W.T]~KSA-DayZ#26 0554949653 +9660554949653