Tudo que CDM postou
-
Aba Skills - TFS 0.4
bom dia e obrigaod por responder, eu quero deixar o lv máximo 717, só quero q ele aparece na aba skill, em level, entendeu ??
-
Aba Skills - TFS 0.4
suspeitei q é na source, deve ser no player.h ou player.cpp, tem q esperar um expert aparecer, msm assim obrigado aí...
-
Aba Skills - TFS 0.4
boa tarde, obrigado, realmente e em stage, mais eu editei lá, agora quando passa de 65k, ele reseta q começa tudo de novo, gostaria de um jeito q não reseta, ia upando,70k,100k,200k e etc....
-
Aba Skills - TFS 0.4
boa tarde, alguém poderia me ajudar, o meu ot, o level passa de 63,400, aí ali na aba skills o máximo q vai é 63400, como faço pra alterar, pra registrar, leveis acima disso, desde já agradeço, obrigado
-
Removendo Account Salt
Meu servidor tem uma vip q o cara ganha e fica sim (vip) nome dele, aonde na source ai faço q ja bloqueado quem tem o nick (vip) pra não criar msm nick exemplo, (vip) teste ai da pra criar playet com nome teste
-
Account Manager Criando Dois Nomes Iguais
mano ajuda lá olha q eu escrevi se tu consegue retirar só o tile vip do script por enquanto já resolveria meu problema
-
Account Manager Criando Dois Nomes Iguais
e o seguinte eu do /addpoints fulano,30 ai o cara ganha 30 pontos ele vai la no bau e clica e troca os pontos q dei ele pelo bau, assim que ele clica no bau ele ganha a vip aí, ai buga se for mais fácil modificar esse script ai pra ele não ficar com a tag (VIP) ta bom ai coloco global events nele de Vip subindo já ate tem no servidor ai num buga criação de conta com mesmo nick se for muito trabalho desbuga assim pode só retirar o (VIP) no nome ele continua ganhando a vip normal só quem sem aparecer (VIP), no aguardo, muito obrigado. local lever = { [7045] = {30,30,{2160}} } function onUse(cid,item,fromPosition,itemEx,toPosition)if getPoints(cid) < lever[item.actionid][1] thenreturn doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "Você precisa de "..lever[item.actionid][1].." points.")endremovePoints(cid,lever[item.actionid][1])local add = (lever[item.actionid][2]*86400)setPlayerStorageValue(cid, 85258, getPlayerStorageValue(cid, 85258) - os.time() <= 0 and (os.time() + add) or (getPlayerStorageValue(cid, 85258) + add))local quantity = math.floor((getPlayerStorageValue(cid, 85258) - os.time())/(24 * 60 * 60)) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você tem ".. quantity .." dias de VIP restantes.") for _, items in pairs(lever[item.actionid][3]) dodoPlayerAddItem(cid,items,1)end if not getCreatureName(cid):find('(VIP)') thendoTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))db.executeQuery("UPDATE `players` SET `name` = '(VIP) "..getCreatureName(cid).."' WHERE `id` = "..getPlayerGUID(cid)..";") addEvent(doRemoveCreature, 3*1000, cid)end return trueend
-
Account Manager Criando Dois Nomes Iguais
obrigado, assim que eu testa te falo o vip ta do mesmo jeito q antes né vai sair sozinho tudo mais tu só tentou arrumar o account manager pra não poder criar player com mesmo nome de quem tem vip né ??
- (2º) | [8.60] - Glorious Server
-
Account Manager Criando Dois Nomes Iguais
problema ta no account manager né não ?? local lever = { [7045] = {30,30,{2160}} } function onUse(cid,item,fromPosition,itemEx,toPosition) if getPoints(cid) < lever[item.actionid][1] then return doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "Você precisa de "..lever[item.actionid][1].." points.") end removePoints(cid,lever[item.actionid][1]) local add = (lever[item.actionid][2]*86400) setPlayerStorageValue(cid, 85258, getPlayerStorageValue(cid, 85258) - os.time() <= 0 and (os.time() + add) or (getPlayerStorageValue(cid, 85258) + add)) local quantity = math.floor((getPlayerStorageValue(cid, 85258) - os.time())/(24 * 60 * 60)) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você tem ".. quantity .." dias de VIP restantes.") for _, items in pairs(lever[item.actionid][3]) do doPlayerAddItem(cid,items,1) end if not getCreatureName(cid):find('(VIP)') then doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) db.executeQuery("UPDATE `players` SET `name` = '(VIP) "..getCreatureName(cid).."' WHERE `id` = "..getPlayerGUID(cid)..";") addEvent(doRemoveCreature, 3*1000, cid) end return true end
-
Account Manager Criando Dois Nomes Iguais
fala galera boa tarde é o seguinte meu servidor tem vip aí quando o cara pega (VIP) Spartan o account manager deixa criar outro boneco somente com o nome Spartan ai quando o vip do cara sai buga db fica dois nomes Spartan como arrumar segue meu login.lua aí local config = { loginMessage = getConfigValue('loginMessage') } function onLogin(cid) local loss = getConfigValue('deathLostPercent') if(loss ~= nil) then doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10) end local accountManager = getPlayerAccountManager(cid) if(accountManager == MANAGER_NONE) then local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage if(lastLogin > 0) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str) str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "." else str = str .. " Please choose your outfit." doPlayerSendOutfitWindow(cid) end doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str) elseif(accountManager == MANAGER_NAMELOCK) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?") elseif(accountManager == MANAGER_ACCOUNT) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to manage your account and if you want to start over then type 'cancel'.") else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to create an account or type 'recover' to recover an account.") end if(not isPlayerGhost(cid)) then doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT) end registerCreatureEvent(cid, "Mail") registerCreatureEvent(cid, "GuildMotd") registerCreatureEvent(cid, "killer") registerCreatureEvent(cid, "Idle") registerCreatureEvent(cid, "attackguild") registerCreatureEvent(cid, "advance") registerCreatureEvent(cid, "FimVip") registerCreatureEvent(cid, "DeathC") registerCreatureEvent(cid, "SkullCheck") registerCreatureEvent(cid, "ReportBug") registerCreatureEvent(cid, "PlayerKill") registerCreatureEvent(cid, "ZombieAttack") registerCreatureEvent(cid, "DeathBroadcast") registerCreatureEvent(cid, "SkullAmulet") registerCreatureEvent(cid, "BlessDrop") registerCreatureEvent(cid, "DeathList") registerCreatureEvent(cid, "GalaxySkullAmulet") registerCreatureEvent(cid, "BloquearMagia") registerCreatureEvent(cid, "onPrepareDeathinifi") registerCreatureEvent(cid, "Aurea") registerCreatureEvent(cid, "checkNewTop") registerCreatureEvent(cid, "LevelRecompense") if (InitArenaScript ~= 0) then InitArenaScript = 1 end for i = 42300, 42309 do setGlobalStorageValue(i, 0) setGlobalStorageValue(i+100, 0) end -- if he did not make full arena 1 he must start from zero if getPlayerStorageValue(cid, 42309) < 1 then for i = 42300, 42309 do setPlayerStorageValue(cid, i, 0) end end -- if he did not make full arena 2 he must start from zero if getPlayerStorageValue(cid, 42319) < 1 then for i = 42310, 42319 do setPlayerStorageValue(cid, i, 0) end end -- if he did not make full arena 3 he must start from zero if getPlayerStorageValue(cid, 42329) < 1 then for i = 42320, 42329 do setPlayerStorageValue(cid, i, 0) end end if getPlayerStorageValue(cid, 42355) == -1 then setPlayerStorageValue(cid, 42355, 0) -- did not arena level end setPlayerStorageValue(cid, 42350, 0) -- time to kick 0 setPlayerStorageValue(cid, 42352, 0) -- is not in arena function Vodka(cid) db.executeQuery("UPDATE `players` SET `name` = '"..string.sub(getCreatureName(cid), 7).."' WHERE `id` = "..getPlayerGUID(cid)) doRemoveCreature(cid) end if getCreatureName(cid):find('(VIP)') and getPlayerStorageValue(cid, 85258) - os.time() <= 0 then doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) addEvent(Vodka,2000,cid) end registerCreatureEvent(cid, "Rankfrags") setFrags(cid) return true end
- (2º) | [8.60] - Glorious Server
-
Anti Mc
fala galera blz boa noite, é o seguinte no meu creatures events num tem nenhum anti mc e mesmo assim não consigo logar duas contas no meu ot, qual outro lugar poderia está bloqueado ?? se eu pego a distro e coloco em outro ot funciona o mc do ot então num é na distro certo ?? se for na distro source posso olhar tbm aonde ??
-
Account Manager
fala galera boa tarde, tem uns ot como esse por exemplo tu só desloga depois q tu criou o seu boneco, sendo q assim tu só desloga uma vez ve aí um exemplo abaixo, gostaria de colocar no meu ot 17:34 Account Manager: Hello, type account to create an account or recover to recover an account. 17:34 Account Manager [8]: account 17:34 Account Manager: What would you like your password to be? 17:34 Account Manager [8]: 17:34 Account Manager: tbgameb00 is it? yes or no? 17:34 Account Manager [8]: yes 17:34 Account Manager: What would you like your account name to be? 17:34 Account Manager [8]: 17:34 Account Manager: otfun, is it? yes or no? 17:34 Account Manager [8]: yes 17:34 Account Manager: Your account has been created, you may manage it now, but please remember your account name otfun and password tbgameb00! 17:34 Account Manager: Hint: Type account to manage your account and if you want to start over then type cancel. 17:34 Account Manager [8]: account 17:34 Account Manager: Do you want to change your password, generate a recovery key, create a character, or delete an existing character? 17:34 Account Manager [8]: character 17:34 Account Manager: What would you like as your character name?
-
Talkaction que só vip pode usar
o do falar em vermelho é ---By Masterpako19--- --Config-- local cash = 500 -- Dinero que se nesecita para hacer el broadcast (en gps) local levelneeded = 8 -- Level necesario para hacer el broadcast local lenght = 100 -- Maximo de caracteres del mensaje local messagesort = MESSAGE_STATUS_WARNING -- can be "MESSAGE_STATUS_WARNING" or "TALKTYPE_ORANGE_1" check your global.lua for more... local exhaustTime = 1 * 60 * 1000 -- tiempo de exausted entre cada mensaje (para cambiar mas minutos cambia el 4 por x cantidad de minutos) local exhaust = createConditionObject(CONDITION_EXHAUST) setConditionParam(exhaust, CONDITION_PARAM_TICKS, exhaustTime) --End of config-- function onSay(cid, words, param) if getCreatureCondition(cid, CONDITION_EXHAUST) == TRUE then doPlayerSendCancel(cid, "Lo siento, nesecitas esperas 1 minutos para mansar otro mensaje") doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) return TRUE end local name = getPlayerName(cid) local level = getPlayerLevel(cid) if isCreature(cid) == TRUE then if param ~= nil then if string.len(param) < lenght then if level >= levelneeded then if doPlayerRemoveMoney(cid, cash) == TRUE then broadcastMessage( ''..name..' ['..level..'] dice: ' .. param .. '', messagesort) --exhaustion.set(cid, storageValue,exhaustTime) doAddCondition(cid, exhaust) return TRUE else doPlayerSendCancel(cid, 'Tu nesecitas '..cash..' gps para hacer un broadcast!') doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) return TRUE end else doPlayerSendCancel(cid, 'Tu nesecitas ser level '..levelneeded..' para hacer un broadcast!') doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) return TRUE end else doPlayerSendCancel(cid, 'No mas de ' .. lenght .. ' caracteres. ') doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) return TRUE end else doPlayerSendCancel(cid, 'Nesecitas escribir algo!') doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) return TRUE end else doPlayerSendCancel(cid, 'You haven\'t a target!') doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) return TRUE end return TRUE end do newtype é esse function onSay(cid, words, param, channel) if(param == '') then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param.") return true end local t = string.explode(param, ",") t[1] = tonumber(t[1]) if(not t[1]) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires numeric param.") return true end local failout = {"73","75","302","266","45","10"} -- outfits proibidas for i = 1, #failout do if string.find(tostring(param), failout) then doPlayerSendCancel(cid,"Não pode usar estas outfit.") return TRUE end end if(t[1] <= 1 or t[1] == 135 or (t[1] > 160 and t[1] < 192) or t[1] > 351) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Such outfit does not exist.") return true end local tmp = getCreatureOutfit(cid) tmp.lookType = t[1] doCreatureChangeOutfit(cid, tmp) return true end do newtype é esse function onSay(cid, words, param, channel) if(param == '') then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param.") return true end local t = string.explode(param, ",") t[1] = tonumber(t[1]) if(not t[1]) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires numeric param.") return true end local failout = {"73","75","302","266","45","10"} -- outfits proibidas for i = 1, #failout do if string.find(tostring(param), failout) then doPlayerSendCancel(cid,"Não pode usar estas outfit.") return TRUE end end if(t[1] <= 1 or t[1] == 135 or (t[1] > 160 and t[1] < 192) or t[1] > 351) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Such outfit does not exist.") return true end local tmp = getCreatureOutfit(cid) tmp.lookType = t[1] doCreatureChangeOutfit(cid, tmp) return true end
- [ERRO] EM meu Servidor da erro ao logar no char.
- (Resolvido)Erro ao Logar char novo!
-
Nome Duplicado Script Vip
eu q reparei eu do um dia de vip pro cara eu vou no boneco e do !vipdays fala q ele tem 0 dias pq sera?? ai tem hora q eu uso comando /delvip e retiro a vip o cara continua com 0 days so q passando passagem de vip e tbm o cara continua aparecendo [vip] e o nick quero retirar isso
-
Player não Atravessa God
fala galera boa noite, meu ot se um player tentar ir pra um chão q o god ta ele não vai, como arrumar ??
- (2º) | [8.60] - Glorious Server
-
Todos Status Clicando sobre vc
fala galera boa tarde, gostaria de um script q eu clicasse em cima de mim de vez ta mostrando somente minha classe, podia msotrar hp e a mana e a quantidade de reset e o lv obrigado
-
Nome Duplicado Script Vip
desculpa q eu ja instalei 3 vips e ta bugado ta faltando só isso pra mim colocar num dedicado, coloquei seu script e deu esse erro no console [18/03/2016 17:29:28] [Error - LuaScriptInterface::loadFile] data/talkactions/scripts/systemvip.lua:26: 'end' expected (to close 'function' at line 1) near 'elseif' [18/03/2016 17:29:28] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/systemvip.lua) [18/03/2016 17:29:28] data/talkactions/scripts/systemvip.lua:26: 'end' expected (to close 'function' at line 1) near 'elseif' [18/03/2016 17:29:28] [Error - LuaScriptInterface::loadFile] data/talkactions/scripts/systemvip.lua:26: 'end' expected (to close 'function' at line 1) near 'elseif' [18/03/2016 17:29:28] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/systemvip.lua) [18/03/2016 17:29:28] data/talkactions/scripts/systemvip.lua:26: 'end' expected (to close 'function' at line 1) near 'elseif' [18/03/2016 17:29:28] [Error - LuaScriptInterface::loadFile] data/talkactions/scripts/systemvip.lua:26: 'end' expected (to close 'function' at line 1) near 'elseif' [18/03/2016 17:29:28] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/systemvip.lua) [18/03/2016 17:29:28] data/talkactions/scripts/systemvip.lua:26: 'end' expected (to close 'function' at line 1) near 'elseif'
-
Nome Duplicado Script Vip
faal galera blz, eu to com esse script de vip ta funcionando normal mais quando o cara ganha vip ele fica com [vip] mais o nome só q se um outro player criar boneco com mesmo nick dele é possivel como arrumar isso pra tirar esse vip e deixa um efeito de uma msg subindo vip estilo global events de mapa só q no cara -- Script SYtem vip 2.0 -- function onSay(cid, words, param) if(words == "!buyvip") then local price = 5000000 if doPlayerRemoveMoney(cid, price) == TRUE then local days = 30 local daysvalue = days * 24 * 60 * 60 local storageplayer = getPlayerStorageValue(cid, 13540) local timenow = os.time() if getPlayerStorageValue(cid, 13540) - os.time() <= 0 then time = timenow + daysvalue else time = storageplayer + daysvalue end if string.find(tostring(getCreatureName(cid)),"[[Vip]]") then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Foram adicionados ".. days .." dias de VIP no seu character.") setPlayerStorageValue(cid, 13540, time) local quantity = math.floor((getPlayerStorageValue(cid, 13540) - timenow)/(24 * 60 * 60)) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você tem ".. quantity .." dias de VIP restantes.") else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Foram adicionados ".. days .." dias de VIP no seu character.") setPlayerStorageValue(cid, 13540, time) local name = getCreatureName(cid) db.executeQuery("UPDATE `players` SET `name` = '[Vip] "..name.."' WHERE `id` = "..getPlayerGUID(cid)..";") doRemoveCreature(cid) end else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você precisa de "..price.." gp's para colocar vip.") end elseif(words == "!vipdays") then local timenow = os.time() local quantity = math.floor((getPlayerStorageValue(cid, 13540) - timenow)/(24 * 60 * 60)) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você tem ".. (quantity < 0 and 0 or quantity) .." dias de VIP no seu character.") elseif(words == "/checkvip") then if getPlayerAccess(cid) == 5 then if not param then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.") end local player = getPlayerByName(param) if not isPlayer(player) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player "..player.." not found.") end local timenow = os.time() local quantity = math.floor((getPlayerStorageValue(player, 13540) - timenow)/(24 * 60 * 60)) doPlayerPopupFYI(cid, "O jogador tem ".. (quantity < 0 and 0 or quantity) .." dias de VIP no character.") return TRUE end elseif(words == "/addvip") then if getPlayerAccess(cid) == 5 then local t = string.explode(param, ",") if not t[2] then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.") end local player = getPlayerByName(t[1]) local name = getCreatureName(player) local days = t[2] local pid = getPlayerByNameWildcard(t[1]) if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player with this name doesn\'t exist or is offline.") return TRUE end local daysvalue = days*3600*24 local storageplayer = getPlayerStorageValue(player, 13540) local timenow = os.time() local time = storageplayer <= 0 and (timenow + daysvalue) or (storageplayer + daysvalue) if string.find(tostring(getCreatureName(pid)),"[[Vip]]") then doPlayerSendTextMessage(player, MESSAGE_INFO_DESCR, "Foram adicionados "..days.." dias de VIP no seu character.") setPlayerStorageValue(player, 13540, time) local quantity = math.floor((getPlayerStorageValue(player,13540) - timenow)/(3600*24)) doPlayerSendTextMessage(player, MESSAGE_INFO_DESCR, "Você tem "..quantity.." dias de VIP restantes.") else setPlayerStorageValue(player, 13540, time) db.executeQuery("UPDATE `players` SET `name` = '[Vip] "..name.."' WHERE `id` = "..getPlayerGUID(player)..";") doRemoveCreature(player) end end elseif(words == "/delvip") then if getPlayerAccess(cid) == 5 then local dec = MESSAGE_INFO_DESCR if(param == "") then return TRUE,doPlayerSendTextMessage(cid,18,"Command param required.")end local C,t = {},string.explode(param, ",") C.pos = getPlayerPosition(cid) C.uid = getCreatureByName(t[1]) C.time = ((tonumber(t[2]) == nil) and 1 or tonumber(t[2]))*3600*24 --Tempo da vip por dia. C.days = (tonumber(t[2]) == nil) and 1 or tonumber(t[2]) --Dias de vip. if(getPlayerStorageValue(C.uid,13540) < C.time)then doPlayerSendTextMessage(cid,dec,'O jogador '..t[1]..' não possui '..C.days..' dias de vip.') else doPlayerSendTextMessage(cid,dec,'Você removeu '..C.days..' dias de vip do player '..t[1]..'.') setPlayerStorageValue(C.uid,13540,getPlayerStorageValue(C.uid,13540)-C.time) end doSendMagicEffect(C.pos, math.random(28,30)) end end return TRUE end
-
Talkaction que só vip pode usar
ta tudo nesse topico
-
Ajuda Script Vip
mano agora q vi removi o vip deixei oservidor do zero ta dando esse erro aqui me ajuda a conserta aí primeiro o erro [18/03/2016 13:09:13] [Error - CreatureScript Interface] [18/03/2016 13:09:13] buffer:onLogin [18/03/2016 13:09:13] Description: [18/03/2016 13:09:13] (luaRegisterCreatureEvent) Creature not found ao meu login.lua -- ### CONFIG ### -- message send to player by script "type" (types you can check in "global.lua") SHOP_MSG_TYPE = 19 -- time (in seconds) between connections to SQL database by shop script SQL_interval = 30 -- ### END OF CONFIG ### SQL_COMUNICATION_INTERVAL = SQL_interval * 1000 function onLogin(cid) if(InitShopComunication == 0) then local eventServ = addEvent(sql_communication, SQL_COMUNICATION_INTERVAL, {}) InitShopComunication = eventServ end registerCreatureEvent(cid, 'advance') registerCreatureEvent(cid, "PlayerDeath") registerCreatureEvent(cid, "Ushuriel") registerCreatureEvent(cid, "Zugurosh") registerCreatureEvent(cid, "Madareth") registerCreatureEvent(cid, "Golgordan") registerCreatureEvent(cid, "Annihilon") registerCreatureEvent(cid, "Hellgorak") return TRUE end function sql_communication(parameters) local result_plr = db.getResult("SELECT * FROM z_ots_comunication WHERE `type` = 'login';") if(result_plr:getID() ~= -1) then while(true) do id = tonumber(result_plr:getDataInt("id")) action = tostring(result_plr:getDataString("action")) delete = tonumber(result_plr:getDataInt("delete_it")) cid = getPlayerByName(tostring(result_plr:getDataString("name"))) if isPlayer(cid) == TRUE then local itemtogive_id = tonumber(result_plr:getDataInt("param1")) local itemtogive_count = tonumber(result_plr:getDataInt("param2")) local container_id = tonumber(result_plr:getDataInt("param3")) local container_count = tonumber(result_plr:getDataInt("param4")) local add_item_type = tostring(result_plr:getDataString("param5")) local add_item_name = tostring(result_plr:getDataString("param6")) local received_item = 0 local full_weight = 0 if add_item_type == 'container' then container_weight = getItemWeightById(container_id, 1) if isItemRune(itemtogive_id) == TRUE then items_weight = container_count * getItemWeightById(itemtogive_id, 1) else items_weight = container_count * getItemWeightById(itemtogive_id, itemtogive_count) end full_weight = items_weight + container_weight else full_weight = getItemWeightById(itemtogive_id, itemtogive_count) if isItemRune(itemtogive_id) == TRUE then full_weight = getItemWeightById(itemtogive_id, 1) else full_weight = getItemWeightById(itemtogive_id, itemtogive_count) end end local free_cap = getPlayerFreeCap(cid) if full_weight <= free_cap then if add_item_type == 'container' then local new_container = doCreateItemEx(container_id, 1) local iter = 0 while iter ~= container_count do doAddContainerItem(new_container, itemtogive_id, itemtogive_count) iter = iter + 1 end received_item = doPlayerAddItemEx(cid, new_container) else local new_item = doCreateItemEx(itemtogive_id, itemtogive_count) received_item = doPlayerAddItemEx(cid, new_item) end if received_item == RETURNVALUE_NOERROR then doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, 'You received >> '.. add_item_name ..' << from OTS shop.') db.executeQuery("DELETE FROM `z_ots_comunication` WHERE `id` = " .. id .. ";") db.executeQuery("UPDATE `z_shop_history_item` SET `trans_state`='realized', `trans_real`=" .. os.time() .. " WHERE id = " .. id .. ";") else doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, '>> '.. add_item_name ..' << from OTS shop is waiting for you. Please make place for this item in your backpack/hands and wait about '.. SQL_interval ..' seconds to get it.') end else doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, '>> '.. add_item_name ..' << from OTS shop is waiting for you. It weight is '.. full_weight ..' oz., you have only '.. free_cap ..' oz. free capacity. Put some items in depot and wait about '.. SQL_interval ..' seconds to get it.') end end if not(result_plr:next()) then break end end result_plr:free() end local eventServ = addEvent(sql_communication, SQL_COMUNICATION_INTERVAL, parameters) end function checkRecord() local onlinePlayers = getWorldCreatures(0) if(onlinePlayers > getMaxPlayers()) then broadcastMessageEx(MESSAGE_EVENT_ADVANCE, 'New record: ' .. onlinePlayers .. (onlinePlayers > 1 and ' players' or ' player').. ' are logged in.') local save = assert(io.open('record.ini', "wb")) local data = save:read("*number") save:write(onlinePlayers) save:close() end end function getMaxPlayers() local file = assert(io.open('record.ini', "rb")) local t = file:read("*number") file:close() return (t == nil and 0 or t) end