BieHDC
Members-
Posts
296 -
Joined
-
Last visited
Everything posted by BieHDC
-
can you please tell me where to put in this code?
-
Hello, i have an epic bug in the following code, if you spin for a negative ammount of money and loose you get money. but i cant find out how to fix, so please hel me thanks function Spin_Func(thePlayer, cmd, amount) local winchance = math.random(1,3) local spintimer = getElementData(thePlayer,"spintimer") local money = getPlayerMoney(thePlayer) if spintimer == false then if (money >= tonumber(amount)) then if winchance == 1 or winnchance == 3 then outputChatBox("#ffffff"..getPlayerName(thePlayer).." spinned for "..amount.." and lost.", getRootElement(),0,0,0,true) takePlayerMoney(thePlayer,amount) setElementData(thePlayer,"spintimer", true) setTimer( function () setElementData(thePlayer,"spintimer", false) end, 30000,1) elseif winchance == 2 then outputChatBox("#ffffff"..getPlayerName(thePlayer).." spinned for "..amount.."$ and won ".. amount*2 .."$.", getRootElement(),0,0,0,true) givePlayerMoney(thePlayer, amount) setElementData(thePlayer,"spintimer", true) setTimer( function () setElementData(thePlayer,"spintimer", false) end, 30000,1) end else outputChatBox("You don't have enough money!", thePlayer, 255,0,0) end else outputChatBox("You can spin only all 30 Seconds.",thePlayer, 255,0,0) end end addCommandHandler("spin", Spin_Func)
-
i know, but some admins are getting money horny with time...so i also wanna check
-
hello, is there an resouce to log what admins do? i wanna watch my admins if they set money, cars, etc... if you know anything please tell me thanks
-
i set the created water to -1 and saw it is created but not raising
-
maybe can help me there also: viewtopic.php?f=91&t=62015&p=591194#p591194
-
thx man now works
-
has NO output ! i tryed
-
has no output situation: Client -1000 money because of buy something > logout > login > money not lost here script therewhile function onPlayerLogout ( ) local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) and not isGuestAccount ( playeraccount ) then local playermoney = getPlayerMoney ( source ) local playerpoints = getElementData(source,"Points") local playertime = getElementData(source,"Playtime") local playerwins = getElementData(source,"Wins") local playerdeaths = getElementData(source,"Deaths") local playerhunters = getElementData(source,"Hunters") setAccountData ( playeraccount, "money", playermoney ) setAccountData ( playeraccount, "points", playerpoints ) setAccountData ( playeraccount, "playtime", playertime ) setAccountData ( playeraccount, "wins", playerwins ) setAccountData ( playeraccount, "deaths", playerdeaths ) setAccountData ( playeraccount, "hunters", playerhunters ) end end function onPlayerLogin (_, playeraccount ) if ( playeraccount ) then local playermoney = getAccountData ( playeraccount, "money" ) local playerpoints = getAccountData ( playeraccount, "points" ) local playertime = getAccountData ( playeraccount, "playtime" ) local playerwins = getAccountData ( playeraccount, "wins" ) local playerdeaths = getAccountData ( playeraccount, "deaths" ) local playerhunters = getAccountData ( playeraccount, "hunters" ) setPlayerMoney ( source, playermoney ) setElementData(source,"Points",playerpoints or 0) setElementData(source,"Playtime",playertime or 0) setElementData(source,"Wins",playerwins or 0) setElementData(source,"Deaths",playerdeaths or 0) setElementData(source,"Hunters",playerhunters or 0) end end addEventHandler ( "onPlayerLogout", getRootElement ( ), onPlayerLogout ) addEventHandler ( "onPlayerLogin", getRootElement ( ), onPlayerLogin) function money() setPlayerMoney( source, 0 ) end addEventHandler("onPlayerLogout",getRootElement(),money)
-
also dont work in onPlayerLogout function incl admin rights
-
ok also doesnt work same bug
-
doesnt fixed bug sucessfully he loose money on logout, but if he first bought in acc then logout and then login money resettet -.- and if i make onPlayerQuit with onPlayerLogout incl the extra script?
-
Works perfect^thx man and how to change to set money to 0 like so? setPlayerMoney(source, 0) outputChatBox("Only for Admins, but you loose ALL money for trying to buy!", source, 255, 0, 0, true)
-
and what to change?
-
simply down 36 row? and will the money set back on login?
-
This is script for save and load can i add there script? function onPlayerQuit ( ) local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) and not isGuestAccount ( playeraccount ) then local playermoney = getPlayerMoney ( source ) local playerpoints = getElementData(source,"Points") local playertime = getElementData(source,"Playtime") local playerwins = getElementData(source,"Wins") local playerdeaths = getElementData(source,"Deaths") local playerhunters = getElementData(source,"Hunters") setAccountData ( playeraccount, "money", playermoney ) setAccountData ( playeraccount, "points", playerpoints ) setAccountData ( playeraccount, "playtime", playertime ) setAccountData ( playeraccount, "wins", playerwins ) setAccountData ( playeraccount, "deaths", playerdeaths ) setAccountData ( playeraccount, "hunters", playerhunters ) end end function onPlayerLogin (_, playeraccount ) if ( playeraccount ) then local playermoney = getAccountData ( playeraccount, "money" ) local playerpoints = getAccountData ( playeraccount, "points" ) local playertime = getAccountData ( playeraccount, "playtime" ) local playerwins = getAccountData ( playeraccount, "wins" ) local playerdeaths = getAccountData ( playeraccount, "deaths" ) local playerhunters = getAccountData ( playeraccount, "hunters" ) setPlayerMoney ( source, playermoney ) setElementData(source,"Points",playerpoints or 0) setElementData(source,"Playtime",playertime or 0) setElementData(source,"Wins",playerwins or 0) setElementData(source,"Deaths",playerdeaths or 0) setElementData(source,"Hunters",playerhunters or 0) end end addEventHandler ( "onPlayerQuit", getRootElement ( ), onPlayerQuit ) addEventHandler ( "onPlayerLogin", getRootElement ( ), onPlayerLogin)
-
and thats why not working?
-
have you chaged anything on script?
-
hello, i dedcted a bug in a login panel which saves money too. So if player log out then the money is also there and he can buy something and then login again and have lost no money! So i wrote small script for setting money to 0 on logout but i am not sure if works: function money() setPlayerMoney( getRootElement(), 0 ) end addEventHandler("onPlayerLogout",getRootElement(),money) and can you tell me sure that the money will set back on login?
-
water dont start to raise and debugscript 3 no output
-
Ok with onResourceStart worked but timer doesnt wait 30sec anymore Here script again: --server side -- Setting water properties. height = 0 SizeVal = 2998 -- Defining variables. southWest_X = -SizeVal southWest_Y = -SizeVal southEast_X = SizeVal southEast_Y = -SizeVal northWest_X = -SizeVal northWest_Y = SizeVal northEast_X = SizeVal northEast_Y = SizeVal -- OnClientResourceStart function that creates the water. function thaResourceStarting( ) setWaterLevel ( -500, false, false ) water = createWater ( southWest_X, southWest_Y, height, southEast_X, southEast_Y, height, northWest_X, northWest_Y, height, northEast_X, northEast_Y, height ) setWaterLevel ( water, height ) end addEventHandler("onResourceStart", resourceRoot, thaResourceStarting) local maxLevel = 35 -- max level local untilW = 120 -- sec local raising,level = (maxLevel/untilW)/10,0 untilW = nil local runningTimer function editSomeWater() level = level + raising -- level raising setWaterLevel ( water, level ) -- set the level if level >= maxLevel then -- compare values of level and max level setWaterLevel ( water, maxLevel ) -- set it back to max level for perfection if isTimer(runningTimer) then -- check if the timer exist killTimer(runningTimer) -- stop the timer end runningTimer,level,maxLevel = nil,nil,nil -- delete data (ram) end end setTimer (function () -- set a timer for 15000 millisec (15 sec), runs one time "1" runningTimer = setTimer ( editSomeWater, 100, 0 ) -- set an invinity timer to set the water level, (0 = invinity) (only stops when you stop him with killTimer) end,30000,1) outputChatBox ( "#FF0000Water starts to rise in 30sec! Be fast^^", getRootElement(), 255, 255, 255, true ) outputChatBox ( "#FF0000Water starts to rise in 30sec! Be fast^^", getRootElement(), 255, 255, 255, true ) outputChatBox ( "#FF0000Water starts to rise in 30sec! Be fast^^", getRootElement(), 255, 255, 255, true ) outputChatBox ( "#FF0000Water starts to rise in 30sec! Be fast^^", getRootElement(), 255, 255, 255, true ) outputChatBox ( "#FF0000Water starts to rise in 30sec! Be fast^^", getRootElement(), 255, 255, 255, true ) outputChatBox ( "#FF0000Water starts to rise in 30sec! Be fast^^", getRootElement(), 255, 255, 255, true ) outputChatBox ( "#FF0000Water starts to rise in 30sec! Be fast^^", getRootElement(), 255, 255, 255, true )
-
maybe: onResourceStart
-
Yes worked, but i change the eventhandler, because i want a good sync tryed with 2 lan pcs and got not small difference which eventhandler would you take?
