Jump to content

AnnaBelle

Members
  • Posts

    88
  • Joined

  • Last visited

Everything posted by AnnaBelle

  1. Let's say that this is a shooting game, and the store has the option for the player to buy 3x experience and 2x experience for 1 day. How can I ta doing this for a button on a shop panel. addEvent("addVIP",true) addEventHandler("addVIP",getRootElement(),function(source) local account = getPlayerAccount(source) local accName = getAccountName(account) aclGroupAddObject(aclGetGroup("VIP"),"user."..accName) local currentDate = getRealTime().timestamp setAccountData(account,"VIPPurchaseDate",currentDate) outputChatBox("#FF0000[ARENA]#FFFFFFType '#01DF01/checktime#FFFFFF', to check the time of vip.", thePlayer,46,255,46,true) end) function checkPlayersVIP() local plrs = getElementsByType"player" for i=1,#plrs do local account = getPlayerAccount(plrs[i]) local purchaseDate = getAccountData(account,"VIPPurchaseDate") if purchaseDate then local currentDate = getRealTime().timestamp if currentDate - purchaseDate >= 3600*24 then aclGroupRemoveObject(aclGetGroup("VIP"),"user."..getAccountName(account)) outputChatBox("#FF0000[ARENA]#FFFFFFYour VIP has expired.",plrs[i],255,100,100,true) setAccountData(account,"VIPPurchaseDate",false) end end end end setTimer(checkPlayersVIP,10*60*1000,0) addEventHandler("onPlayerLogin",getRootElement(),checkPlayersVIP) addCommandHandler("checktime", function(thePlayer) local purchaseDate = getAccountData(getPlayerAccount(thePlayer), "VIPPurchaseDate") if purchaseDate then local realTime = getRealTime().timestamp local remainingTime = purchaseDate + 86400 - realTime local minutesLeft = remainingTime/60 local hoursLeft = minutesLeft/60 outputChatBox("#FF0000[ARENA]#FFFFFFYour VIP expires in #32FF32"..string.format("%02d",math.floor(hoursLeft)).."#FFFFFF:#32FF32"..string.format("%02d",math.floor(minutesLeft)%60),thePlayer,46,255,46,true) else outputChatBox("#FF0000[ARENA]#FFFFFFYou did not buy VIP.", thePlayer,46,255,46,true) end end) Like this example with VIP
  2. addEvent("2x",true) addEventHandler("2x",getRootElement(),function(source) setElementData(source,"experience",expvalue*mult) end) It would be like this?
  3. But I tested it on vps and I could not get the xp of the weekend caught during the week But let's say it can end up happening, what should I do? You know how I can ta making a button to buy experience in double or triple
  4. thank you
  5. He's not even giving a bug now, but he's only calling 2 and not 2x [INFO] Você matou: 7Theroii || Arma: Sniper || Distância: 2m || Exp: 300 2
  6. I'm testing here, a moment.
  7. Sorry, it was my mistake now
  8. Gave error
  9. Type when the player kills another appears on the 2x or 3x side Ex:[INFO] You Killed: ^NewYork || Weapon: Sniper || Distance: 200m || Exp: 286 x3
  10. I want the 2x message to appear on the weekend, during the week it does not appear
  11. Just wait, I'll modify it and test it if killer then if not getElementData(source,"bandit") then addPlayerStats (killer,"humanity",math.random(-2500,-1000)) else addPlayerStats (killer,"humanity",math.random(1000,2500)) end setElementData(killer,"murders",getElementData(killer,"murders")+1) local modifier = 1 local day = getRealTime().weekday if day == 0 then modifier = 3 elseif day == 6 then -- 0 = sun 6 = sat modifier = 2 end local experiences = math.random(200,300)*modifier setElementData(killer,"experience",getElementData(killer,"experience") + experiences) if getElementData(killer,"humanity") < 0 then setElementData(killer,"bandit",true) end if getElementData(source,"bandit") == true then setElementData(killer,"banditskilled",getElementData(killer,"banditskilled")+1) end if headshot == true then setElementData(killer,"headshots",getElementData(killer,"headshots")+1) end local xX,yY,zZ = getElementPosition(source) local xk,yk,zk = getElementPosition(killer) local Distancia = getDistanceBetweenPoints3D(xX,yY,zZ,xk,yk,zk) outputChatBox("[INFO]#FFFFFF Você matou: #32FF32"..getPlayerName(source):gsub('#%x%x%x%x%x%x',''):gsub('#%x%x%x%x%x%x','').."#FFFFFF || Arma: #32FF32"..(weapon or "Unknown").."#FFFFFF || Distância: #32FF32"..math.floor(Distancia).."m #FFFFFF || Exp: #32FF32"..experiences,killer,0,128,255,true) outputChatBox("[INFO]#FFFFFF Você foi morto por: #32FF32"..getPlayerName(killer):gsub('#%x%x%x%x%x%x',''):gsub('#%x%x%x%x%x%x','').."#FFFFFF || Arma: #32FF32"..(weapon or "Unknown").."#FFFFFF || Distância: #32FF32"..math.floor(Distancia).."m",source,0,128,255,true) setTimer(function(source,killer)end,6000,1,source) triggerClientEvent("onRollMessageStart",getRootElement(),getPlayerName(source):gsub('#%x%x%x%x%x%x',''):gsub('#%x%x%x%x%x%x','').." foi morto por "..getPlayerName(killer):gsub('#%x%x%x%x%x%x',''):gsub('#%x%x%x%x%x%x',''),255,255,255, "died") else triggerClientEvent("onRollMessageStart",getRootElement(),getPlayerName(source):gsub('#%x%x%x%x%x%x',''):gsub('#%x%x%x%x%x%x','').." morreu.",255,255,255, "died") end The whole function is this, but there is nothing wrong with my seeing.
  12. Every time the player kills himself on the grenade a bug happens
  13. getDistanceBetweenPoints3D
  14. I managed to fix it, except the message that appears
  15. outputChatBox("[INFO]#FFFFFF Você matou: #32FF32"..getPlayerName(source):gsub('#%x%x%x%x%x%x',''):gsub('#%x%x%x%x%x%x','').."#FFFFFF || Arma: #32FF32"..(weapon or "Unknown").."#FFFFFF || Distância: #32FF32"..math.floor(Distancia).."m #FFFFFF || Exp: #32FF32"..experiences.."#F7FE2E 2x",killer,0,128,255,true) [2017-04-15 21:00:53] ERROR: [DayZ]\DayZ\spawn.lua:242: bad argument #1 to 'floor' (number expected, got nil) math.floor Should not give error because I use this line to show on the player's local distance, weapon, experience local modifier = 1 local day = getRealTime().weekday if day == 0 or day == 6 then -- 0 = sun 6 = sat modifier = 2 end local experiences = math.random(200,300)*modifier setElementData(killer,"experience",getElementData(killer,"experience") + experiences) Every time I kill the grenade, I get bugged on the server, because of this function
  16. https://forum.multitheftauto.com/topic/94781-help-me-patent-level/ System of level
  17. Now it's thanks. Do you understand anything experience and level?
  18. The message that appears is the time your vip is already active, not the time left to expire,So show the time you already used. Your VIP expires in 00:22
  19. Your VIP expires in 03:185 ,Are you sure?
  20. You have to make a command that the player can see how many hours the pro VIP expires expire
  21. Has to appear in the chat when this event is active outputChatBox("[INFO]#FFFFFF Você matou: #32FF32"..getPlayerName(source):gsub('#%x%x%x%x%x%x',''):gsub('#%x%x%x%x%x%x','').."#FFFFFF || Arma: #32FF32"..(weapon or "Unknown").."#FFFFFF || Distância: #32FF32"..math.floor(Distancia).."m #FFFFFF || Exp: #32FF32"..experiences.."#F7FE2E 2x",killer,0,128,255,true) like that I want the 2x message to appear on the weekend, during the week it does not appear
  22. Yes, but where will you double your experience?
  23. Yes I know this function but I do not know how to do
  24. Gain double experience over the weekend, Only at the weekend. setElementData(killer,"murders",getElementData(killer,"murders")+1) local experiences = math.random(200,300) setElementData(killer,"experience",getElementData(killer,"experience") + experiences) Ex: [INFO] You Killed: ^NewYork || Weapon: Sniper || Distance: 200m || Exp: 286 x2
×
×
  • Create New...