Jump to content

HuskLV

Members
  • Posts

    18
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

HuskLV's Achievements

Square

Square (6/54)

1

Reputation

  1. Maybe you can put script where this function inside?
  2. Maybe try function onPlayerWin(thePlayer) and other line change player -> thePlayer
  3. No, this is UG, but i make inside token system.
  4. Check your script define player, maybe thePlayer or source try. in this. exports["rangos_bejelentkezes"]:addNotification(thePlayerthePlayerT, "Megnyerted a reakció tesztet!", "success") or exports["rangos_bejelentkezes"]:addNotification(source, "Megnyerted a reakció tesztet!", "success")
  5. Hey. I make interior system with token, but i want make if interior is buying by token you can't sell him. There script. function sellProperty(thePlayer, commandName, bla) if bla then outputChatBox("Use /sell to sell another player.", thePlayer, 255, 0, 0) return end local dbid, entrance, exit, interiorType, interiorElement = findProperty( thePlayer ) if dbid > 0 then if interiorType == 2 then outputChatBox("You can't sell government interior.", thePlayer, 255, 0, 0) elseif interiorType ~= 3 and commandName == "unrent" then outputChatBox("You are not renting this interior.", thePlayer, 255, 0, 0) else local interiorStatus = getElementData(interiorElement, "status") if interiorStatus[INTERIOR_OWNER] == getElementData(thePlayer, "dbid") or ( getElementData(thePlayer, "factionleader") > 0 and interiorStatus[INTERIOR_FACTION] == getElementData(thePlayer, "faction")) then local interiorToken = mysql:query_fetch_assoc("SELECT `token` FROM `interiors` WHERE `owner`='"..getElementData(thePlayer, "dbid").."'") if interiorToken == 0 then publicSellProperty(thePlayer, dbid, true, true, false) cleanupProperty(dbid, true) exports.logs:dbLog(thePlayer, 37, { "in"..tostring(dbid) } , "SELLPROPERTY "..dbid) local addLog = mysql:query_free("INSERT INTO `interior_logs` (`intID`, `action`, `actor`) VALUES ('"..tostring(dbid).."', '"..commandName.."', '"..getElementData(thePlayer, "account:id").."')") or false if not addLog then outputDebugString("Failed to add interior logs.") end else outputChatBox("You can't sell interior, because this interior bought by token!", thePlayer, 255, 0, 0) end else outputChatBox("You are not interior owner.", thePlayer, 255, 0, 0) end end else outputChatBox("You are not in interior.", thePlayer, 255, 0, 0) end end addCommandHandler("sellproperty", sellProperty, false, false) addCommandHandler("unrent", sellProperty, false, false)
  6. carshop:cost work! Because with cash and bank i can buy, but i make token and that's not working. Error not shows.
  7. local costCar = getElementData(source, "carshop:cost") if (paymentMethod == "cash") then if not exports.global:hasMoney(client, costCar) or costCar == 0 then if isOverlayDisabled then outputChatBox("You don't have enough money on hand for this pal..", client, 0, 255, 0) else exports.hud:sendBottomNotification(client, "Money is always a problem..", "You don't have enough money on hand for this pal..") end return false else exports.global:takeMoney(client, costCar) end elseif (paymentMethod == "bank") then local money = getElementData(client, "bankmoney") - costCar if money < 0 or costCar == 0 then if isOverlayDisabled then outputChatBox("You don't have enough money in your bank account for this pal..", client, 0, 255, 0) else exports.hud:sendBottomNotification(client, "Money is always a problem..", "You don't have enough money in your bank account for this pal..") end else exports.anticheat:changeProtectedElementDataEx(client, "bankmoney", money, false) mysql:query_free("UPDATE characters SET bankmoney=" .. mysql:escape_string((tonumber(money) or 0)) .. " WHERE id=" .. mysql:escape_string(getElementData( client, "dbid" ))) end elseif (paymentMethod == "coin") then if itemID == 300 and costCar < 15000 then if isOverlayDisabled then outputChatBox("Jūs nevarat iegādāties dārgāku par 15'000$ caur šo kuponu!", client, 0, 255, 0) else exports.hud:sendBottomNotification(client, "Nederīgs kupons - 15'000$", "Jūs nevarat iegādāties dārgāku par 15'000$ caur šo kuponu!") end else takeItemFromSlot(client, 300)--HUSKLV end else if isOverlayDisabled then outputChatBox("No.", client, 0, 255, 0) else exports.hud:sendBottomNotification(client, "No!", "Just no...") end return false end
  8. --CLIENT SIDE if itemID == 300 then gui["btnCoin"] = guiCreateButton(232, 140, 105, 41, "Redeem token", false, gui["_root"]) addEventHandler("onClientGUIClick", gui["btnCoin"], carshop_buyCar_click, false) guiSetEnabled(gui["btnCoin"], coinEnabled) else gui["btnCash"] = guiCreateButton(10, 140, 105, 41, "Pay by cash", false, gui["_root"]) addEventHandler("onClientGUIClick", gui["btnCash"], carshop_buyCar_click, false) guiSetEnabled(gui["btnCash"], cashEnabled) end function carshop_buyCar_click() if exports.global:hasSpaceForItem(getLocalPlayer(), 3, 1) then local sourcestr = "cash" if (source == gui["btnBank"]) then sourcestr = "bank" elseif (source == gui["btnCoin"]) then sourcestr = "coin" end triggerServerEvent("carshop:buyCar", theVehicle, sourcestr) else outputChatBox("You don't have space in your inventory for a key", 0, 255, 0) end carshop_buyCar_close() end --SERVER SIDE elseif (paymentMethod == "coin") then if itemID == 300 and costCar < 15000 then if isOverlayDisabled then outputChatBox("Token 15'000$ you dont have token with up to 15'000$!", client, 0, 255, 0) else exports.hud:sendBottomNotification(client, "Wrong token - 15'000$", "Token 15'000$ you dont have token with up to 15'000$!") end else takeItemFromSlot(client, 300) end
  9. Hey, i make carshop system new button "token" with buy car. If you have token you can buy car with him, please help with this. client side: if itemID == 300 then gui["btnCoin"] = guiCreateButton(232, 140, 105, 41, "Redeem token", false, gui["_root"]) addEventHandler("onClientGUIClick", gui["btnCoin"], carshop_buyCar_click, false) guiSetEnabled(gui["btnCoin"], coinEnabled) else gui["btnCash"] = guiCreateButton(10, 140, 105, 41, "Pay by cash", false, gui["_root"]) addEventHandler("onClientGUIClick", gui["btnCash"], carshop_buyCar_click, false) guiSetEnabled(gui["btnCash"], cashEnabled) end function carshop_buyCar_click() if exports.global:hasSpaceForItem(getLocalPlayer(), 3, 1) then local sourcestr = "cash" if (source == gui["btnBank"]) then sourcestr = "bank" elseif (source == gui["btnCoin"]) then sourcestr = "coin" end triggerServerEvent("carshop:buyCar", theVehicle, sourcestr) else outputChatBox("You don't have space in your inventory for a key", 0, 255, 0) end carshop_buyCar_close() end server side: elseif (paymentMethod == "coin") then if itemID == 300 and costCar < 15000 then if isOverlayDisabled then outputChatBox("Token 15'000$ you dont have token with up to 15'000$!", client, 0, 255, 0) else exports.hud:sendBottomNotification(client, "Wrong token - 15'000$", "Token 15'000$ you dont have token with up to 15'000$!") end else takeItemFromSlot(client, 300) end Please help me!
  10. Hello, I have been working on my ROLEPLAY server and i need some good scripter for roleplay new scripts. Just write me pm or comment if you want script for Money new roleplay scripts. Wait for your answers.
  11. Not work. Error in - local atkariba = mysql:query_free("SELECT `atkaribaLVL` FROM `characters` WHERE `id`='".. getElementData( thePlayer, "dbid" ).."'")
  12. function atkaribasCheck() local atkariba = mysql:query_free("SELECT `atkaribaLVL` FROM `characters` WHERE `id`='".. getElementData( thePlayer, "dbid" ).."'") if (tonumber(atkariba>10)) then outputChatBox("Jūs esiet atkarīgs no narkotikām, lai ārstētos Jums jālieto vēl vai jādodas uz slimnīcu!", thePlayer) else outputDebugString("INFO: Atkarības sistēma work!") end end Viss ir pareizi savadīts. Nomainīju if (tonumber(atkariba>10)) then un pārveidoju nedaudz to atkariba tāpat ir tas pats errors.
×
×
  • Create New...