Ir para conteúdo

Rodrigo94

Campones
  • Total de itens

    9
  • Registro em

  • Última visita

Sobre Rodrigo94

Informações

  • Forma que conheci o xTibia
    Sites de Busca
  • Sou
    OT-Admin

Últimos Visitantes

6717 visualizações

Rodrigo94's Achievements

  1. Tudo bem galera? preciso de ajuda, coloquei em meu shop no site para vender as outfits mas não estou conseguindo fazer o script para quando o player comprar no site ir pra ele em game.. Sou noob em lua, alguem poderia me ajudar?? (o script tentei copiar de outro servidor e encaixar no meu, mas o código completo do servidor não reconheceu no meu distro ai tentei fazer uma gambiarra usando o meu mesmo e adicionando somente o código do outfit Código que estou tentando fazer: Erros no distro: [Warning - Event::loadScript] Cannot load script (data/globalevents/scripts/shop.lua) [20:34:38.306] data/globalevents/scripts/shop.lua:92: 'end' expected (to close 'function' at line 11) near '<eof>' -- ### 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 ### --- ### Outfits List ### local femaleOutfits = {["citizen"] = 136, ["hunter"] = 137, ["knight"] = 139, ["noblewoman"]=140, ["summoner"]=141, ["warrior"]=142, ["barbarian"]=147, ["druid"]=148, ["wizard"]=149, ["oriental"]=150, ["pirate"]=155, ["assassin"]=156, ["beggar"]=157, ["shaman"]=158, ["norsewoman"]=252, ["nightmare"]=269, ["jester"]=270, ["brotherhood"]=279, ["demonhunter"]=288, ["yalaharian"]=324, ["warmaster"]=336} local maleOutfits = {["citizen"]=128, ["hunter"]=129, ["mage"]=130, ["knight"]=131, ["nobleman"]=132,["summoner"]=133, ["warrior"]=134, ["barbarian"]=143, ["druid"]=144, ["oriental"]=146, ["pirate"]=151, ["assassin"]=152, ["beggar"]=153, ["shaman"]=154, ["norsewoman"]=251, ["nightmare"]=268, ["jester"]=273, ["brotherhood"]=278, ["demonhunter"]=289, ["yalaharian"]=325, ["warmaster"]=335, ["wayfarer"]=366} function onThink(interval, lastExecution) 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 = getCreatureByName(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 ProTibia 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 ProTibia 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 ProTibia 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 if(action == 'give_outfit') then if outfit_name ~= "" and maleOutfits[outfit_name] and femaleOutfits[outfit_name] then local add_outfit = getPlayerSex(cid) == 0 and femaleOutfits[outfit_name][1] or maleOutfits[outfit_name][1] if not canPlayerWearOutfit(cid, add_outfit, 3) then db.query("DELETE FROM `z_ots_comunication` WHERE `id` = " .. id .. ";") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GIFT_WRAPS) doPlayerAddOutfit(cid, add_outfit, 3) doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, "You received the outfit " .. add_item_name .. " of our Shop Online.") else doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, "You already have this outfit. Your coins were returned, thank you.") db.query("DELETE FROM `z_ots_comunication` WHERE `id` = " .. id .. ";") db.query("UPDATE `accounts` SET `premium_points` = `premium_points` + " .. coins .. " WHERE `id` = " .. getAccountNumberByPlayerName(cid) .. ";") end end end if not(result_plr:next()) then break end end result_plr:free() end return TRUE end
  2. Fala galera do Xtibia, estou usando um gesior 0.3.8 mas não gostaria de trocar pois eu fiz varios sistemas legais nele... Mas estou com um problema, tem pessoas criando char com uma letra só nome exemplo: "X", "A"... Gostaria de bloquear para pelo menos 3 caractéres no nome, e meu account manager também está igual... Você consegue criar uma acc com 1 letra só, grato pela atenção!
  3. Obrigado @Gengo era isso mesmo, consegui fazer ontem rep++
  4. Boa tarde galera! estou precisando do código fonte pra compilar o emoted spells, achei um mas sem sucesso ao compilalo... Explicando: você consegue ativar o emoted spells ON (MAGIAS SEM SPAWNAR O CHAT EM LARANJA) e desativar !emotedspells OFF (MAGIAS NO CHAT AMARELO). Segue o código que eu tentei compilar: game.h bool internalCreatureSay(Creature* creature, SpeakClasses type, const std::string& text, bool ghostMode, SpectatorVec* spectators = NULL, Position* pos = NULL, bool isSpell = false); game.cpp bool Game::internalCreatureSay(Creature* creature, SpeakClasses type, const std::string& text, bool ghostMode, SpectatorVec* spectators/* = NULL*/, Position* pos/* = NULL*/, bool isSpell/* = false*/) for(it = list.begin(); it != list.end(); ++it) { if(!(tmpPlayer = (*it)->getPlayer())) continue; if(!ghostMode || tmpPlayer->canSeeCreature(creature)) { if(isSpell) { // to jest spell std::string strValue; if(tmpPlayer->getStorage("58678", strValue)) { // storage jest ustawione int32_t intValue = atoi(strValue.c_str()); if(intValue) { // storage jest liczba i ma wartosc inna niz 0, typ tekstu 'monster' tmpPlayer->sendCreatureSay(creature, SPEAK_MONSTER_SAY, text, &destPos); } else { // storage rowne 0, domyslny typ tekstu tmpPlayer->sendCreatureSay(creature, type, text, &destPos); } } else { // storage nie ustawione, domyslny typ tekstu tmpPlayer->sendCreatureSay(creature, type, text, &destPos); } } else { tmpPlayer->sendCreatureSay(creature, type, text, &destPos); } } } spells.cpp return g_game.internalCreatureSay(player, type, ret, player->isGhost(), NULL, &pos, true) ? RET_NOERROR : RET_NOTPOSSIBLE; Talkaction para ativar o comando function onSay(cid, words, param) if param == "emote" and getCreatureStorage(cid, 58678) < 1 then doCreatureSetStorage(cid, 58678, 1) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have enabled emoted spells.") elseif param == "normal" and getCreatureStorage(cid, 58678) == 1 then doCreatureSetStorage(cid, 58678, 0) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have disabled emoted spells.") end return false end ERRO AO COMPILAR:
  5. Fala galera, sou iniciante em website entendo bem pouco.. Estou tentando adicionar o market char system no meu gesior acc maker Peguei um script de um forum e estou tentando editar.. o script está funcionando, porém eu não estou conseguindo criar um botão pra cancelar a venda de um char e não consigo criar um código para que venda char acima do level 100+ Algum bom scripter consegue me ajuda? Script: accountmanager $main_content .= '<TABLE BORDER=1 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['site']['vdarkborder'].'><TD CLASS=white width="64px"><CENTER><B>Sell your characters</B></CENTER></TD></TR>'; $main_content .= '<TR BGCOLOR='.$config['site']['darkborder'].'><TD CLASS=black width="64px"><B></B>'; $charArray = array(); $acct = false; $players_from_logged_acc = $account_logged->getPlayersList(); $players_from_logged_acc->orderBy('name'); $main_content .= '<form action="" method="post"><select name="char">'; foreach($players_from_logged_acc as $player) { $charArray[] = $player->getName(); $main_content .= '<option>'.$player->getName().'</option>'; } $main_content .= '</select>Select a character to sell<br>'; $main_content .= '<input type="text" name="price" maxlength="10" size="4" >Select the price of the character<br>'; $main_content .= '<input type="submit" name="submit" value="Sell character"></TD></TR>'; $main_content .= '</form></table>'; if (isset($_POST['submit'])) { $char = stripslashes($_POST['char']); $price = stripslashes($_POST['price']); $tmp = str_replace("'", '', $char); if (in_array($tmp, $charArray )) { $acct = true; } if ($char && $price && $acct) { if(is_numeric(trim($_POST['price']))) { $check2 = $SQL->query("SELECT * FROM `players` WHERE `name` = '$char'") or die(mysql_error()); foreach ($check2 as $re) { $voc = $re['vocation']; $oid = $re['account_id']; } $check1 = $SQL->query("UPDATE `players` SET `account_id` = 1 WHERE `name` = '$char'") or die(mysql_error()); $check3 = $SQL->query("INSERT INTO `sellchar` VALUES ('','$char','$voc','$price','1','$oid')"); $main_content .= '<b><center>You added your character correctly, thanks!</b></center>'; header("Location: index.php?subtopic=buychar"); } else { $main_content .= '<b><center>Set a numeric price!!</b></center>'; } } else { $main_content .= '<b><center>Fill out all fields!</b></center>'; } } $main_content .= '<br>'; $main_content .= '<div class="SmallBox" ><div class="MessageContainer" > <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div><div class="BoxFrameEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div><div class="BoxFrameEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div><div class="Message" ><div class="BoxFrameVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div><div class="BoxFrameVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div><table><tr><td class="LabelV" >Hint:</td><td style="width:100%;" >If you put your character on sale anyone can buy it, you will lose acces to that character and you wont be able to log in with that character until someone buys it, you can also delete your offer by buying your own character!<br><b>When someone buys your character you will get the price in points!</td></tr></table><div align="center" ><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement&action=registeraccount" method="post" ><tr><td style="border:0px;" ></div></div></td></tr></form></table></div></div> <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div><div class="BoxFrameEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div><div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div> </div></div><br/>';
  6. ProTibia Global 8.60 Novo servidor, mapa 100% full todos os sistemas implantados! Site: www.pro-tibia.servegame.com IP: pro-tibia.servegame.com PORT: 7171 8.60 Rates: 1-100:x100 51-75:x75 71-100:x50 101-120:x30 121-140:x15 141-160:x6.5 161-400:x1 401+:x0.5 401+: 27x Magic: 9.5x Loot: 2.0x Config: Red Skull Time = 5 day Black Sukll Time = 10 day White Skull Time = 10 minutes Protection Level = 60 Level To Buy House = 100 Free Premium = Yes Venha já conferir, monte seu Time e faça parte desta aventura!
  7. Alguem ainda tem esse servidor? gostaria muito do verdadeiro Snowz yurots com as magias editadas dele e os monstros
  • Quem Está Navegando   0 membros estão online

    • Nenhum usuário registrado visualizando esta página.
×
×
  • Criar Novo...