Ir para conteúdo
  • Cadastre-se

Ajudem com Lottery System no Gesior


Posts Recomendados

Os players recebem itens no Globalevents lottery mais não está aparecendo no site como poderia arrumar?

Meu Script em \data\globalevents\scripts\lottery:

local config = {

lottery_hour = "3 Hours", -- Time to next lottery (real time you set on globalevents.xml, its only for broadcast message.)

rewards_id = {2494, 2472, 2514, 2493, 2470, 2195, 2173, 2160, 2520}, -- Rewards ID

crystal_counts = 100, -- used only if on rewards_id you have crystal coins (ID: 2160).

website = "yes" -- Do you have `lottery` table in your database?

}

function onThink(interval, lastExecution)

local players = getPlayersOnline()

local list = {}

for i, tid in ipairs(players) do

list = tid

end

local winner = list[math.random(1, #list)]

local random_item = config.rewards_id[math.random(1, #config.rewards_id)]

local item_name = getItemNameById(random_item)

local world = tonumber(getPlayerWorldId(winner))

if(random_item == 2160) then

doPlayerAddItem(winner, random_item, config.crystal_counts)

doBroadcastMessage('[baiak Rock Lottery] Winner: '.. getCreatureName(winner) ..', Reward: '.. config.crystal_counts ..' '.. item_name ..'s! Congratulations! (Next Lottery in '.. config.lottery_hour ..')')

else

doBroadcastMessage('[baiak Rock Lottery] Winner: '.. getCreatureName(winner) ..', Reward: '.. item_name ..'! Congratulations! (Next Lottery in '.. config.lottery_hour ..')')

doPlayerAddItem(winner, random_item, 1)

end

if(config.website == "yes") then

db.executeQuery("INSERT INTO `lottery` (`name`, `item`, `world_id`) VALUES ('".. getCreatureName(winner) .."', '".. item_name .."', '".. world .."');")

end

return TRUE

end

Minha tabela Lottery no banco de dados:

-- Estrutura da tabela `lottery`

--

CREATE TABLE IF NOT EXISTS `lottery` (

`id` int(11) NOT NULL AUTO_INCREMENT,

`name` varchar(255) NOT NULL,

`item` varchar(255) NOT NULL,

`world_id` tinyint(2) unsigned NOT NULL DEFAULT '0',

PRIMARY KEY (`id`)

) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=695 ;

No meu index.php está assim:

case "lottery";

$topic = "Lottery";

$subtopic = "lottery";

include("lottery.php");

break;

Meu arquivo lottery.php está assim: (OBS: quando clico no link loterry no site apareçe la em cim este erro (

Warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\lottery.php on line 84)

<?PHP

//Criado por Dhenyz Shady from shadyroom.blogspot.com

//Favor manter os créditos / Please keep the credits

//Use e abuse / Enjoy!

header("Content-Type: text/html; charset=ISO-8859-1",true) ;

$lotterys = $SQL->query("SELECT `id`, `name`, `item` FROM lottery ORDER BY `id` ASC LIMIT 20;");$players = 0;

$main_content .= ' <h1><center>- '.$config['server']['serverName'].' Lottery System -</center></h1>

Esse sistema sorteia de <b>3 em 3hrs</b> um player <font color="green">ONLINE</font> no servidor para dar um item a ele, e os items disponíveis na loteria são:

<br></br>

<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD CLASS=white><B>Itens Sorteados:</B></TD></TR></TABLE>

<table border="1" width="100%">

<tr>

<td><p align="center"><img src="images/items/2493.gif"</img><br /> Demon Helmet</p></td>

<td>You see a demon helmet (Arm:10).

It weighs 29.50 oz.</td>

</tr>

<tr>

<td><p align="center"><img src="images/items/2494.gif"</img><br /> Demon Armor</p></td>

<td>You see a demon armor (Arm:16).

It weighs 80.00 oz.</td>

</tr>

<tr>

<td><p align="center"><img src="images/items/2495.gif"</img><br /> Demon Legs </p></td>

<td>You see demon legs (Arm:9).

It weighs 54.00 oz.</td>

</tr>

<tr>

<td><p align="center"><img src="images/items/2195.gif"</img><br /> Boots of haste</p></td>

<td>You see boots of haste (speed +15).

It weighs 7.50 oz.</td>

</tr>

<tr>

<td><p align="center"><img src="images/items/2514.gif"</img><br /> Mastermind Shield</p></td>

<td>You see a mastermind shield (Def:37).

It weighs 57.00 oz.</td>

</tr>

<tr>

<td><p align="center"><img src="images/items/2520.gif"</img><br /> Demon Shield</p></td>

<td>You see a demon shield (Def:35).

It weighs 38.00 oz.</td>

</tr>

<tr>

<td><p align="center"><img src="images/items/2472.gif"</img><br /> Magic Plate Armor</p></td>

<td>You see a magic plate armor (Arm:17).

It can only be wielded properly by elite knights and royal paladins.

It weighs 85.00 oz.</td>

</tr>

<tr>

<td><p align="center"><img src="images/items/2470.gif"</img><br /> Golden Legs </p></td>

<td>You see golden legs (Arm:9).

It can only be wielded properly by elite knights and royal paladins.

It weighs 54.00 oz.</td>

</tr>

<tr>

<td><p align="center"><img src="images/items/2160.gif"</img><br /> 100 Crystal coins</p></td>

<td>100,000 Gold.</td>

</tr>

</table>

<br />';

if(empty($lotterys))

{

$main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD CLASS=white><b>Auctions</b></td></TR><TR BGCOLOR=.$config['site]['darkborder'].'><TD>Currently is no one active Auction.</TD></TR></TABLE>';

$main_content .= '<br /><p align="right"><small></small></p>';

}

else

{

foreach($lottery as $lottery) {

$players++;

if(is_int($players / 2))

$bgcolor = $config['site']['lightborder'];

else

$bgcolor = $config['site']['darkborder'];

$cost = round($auction['cost']/1000, 2);

$content .= '<TR BGCOLOR='.$bgcolor.'><TD><center>'.$lottery['id'].'</center></TD><TD><center>'.$lottery['item'].'</center></TD><TD><center><a href=?subtopic=characters&name='.urlencode($lottery['name]).'">'.$lottery['name'].'</a></center></TD></TR>';

}

$main_content .= 'Os ultimos 20 sorteios:<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD CLASS=white><b><center>ID</center></b></TD><TD class="white"><b><center>Item</center></b></TD><TD class="white"><b><center>Sortudo</center></b></td></TR>'.$content.'</TABLE>';

$main_content .= '';

}

?>

E em layouts está assim:

<a href='?subtopic=lottery'>

<div id='submenu_lottery' class='Submenuitem' onmouseover='MouseOverSubmenuItem(this)' onmouseout='MouseOutSubmenuItem(this)'>

<div class='LeftChain' style='background-image:url(layouts/tibiacom/images/general/chain.gif);'></div>

<div id='ActiveSubmenuItemIcon_lottery' class='ActiveSubmenuItemIcon' style='background-image:url(layouts/tibiacom/images/menu/icon-activesubmenu.gif);'></div>

<div class='SubmenuitemLabel'><font color="white"><font color="1fcb64">Lottery</font></div>

<div class='RightChain' style='background-image:url(layouts/tibiacom/images/general/chain.gif);'></div>

</div>

</a>

Link para o post
Compartilhar em outros sites

TibiaKing ta precisando de um supervisor ou colaborador em web eu nem sei mecher nesses sites so no visual mesmo

acho que o thiago parceiro meu sabe que é isso se eu achar algo te aviso aqui!!

~Charlie Brown Jr

Link para o post
Compartilhar em outros sites

Troca o lottery.php por esse ai



<?PHP

//Criado por Dhenyz Shady from shadyroom.blogspot.com

//Favor manter os créditos / Please keep the credits

//Use e abuse / Enjoy!

header("Content-Type: text/html; charset=ISO-8859-1",true) ;

$lotterys = $SQL->query("SELECT `id`, `name`, `item` FROM lottery ORDER BY `id` ASC LIMIT 20;");$players = 0;

$main_content .= ' <h1><center>- '.$config['server']['serverName'].' Lottery System -</center></h1>

Esse sistema sorteia de <b>3 em 3hrs</b> um player <font color="green">ONLINE</font> no servidor para dar um item a ele, e os items disponíveis na loteria são:

<br></br>

<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD CLASS=white><B>Itens Sorteados:</B></TD></TR></TABLE>

<table border="1" width="100%">

<tr>

  <td><p align="center"><img src="images/items/2493.gif"</img><br /> Demon Helmet</p></td>

  <td>You see a demon helmet (Arm:10).

It weighs 29.50 oz.</td>

</tr>

<tr>

  <td><p align="center"><img src="images/items/2494.gif"</img><br /> Demon Armor</p></td>

  <td>You see a demon armor (Arm:16).

It weighs 80.00 oz.</td>

</tr>

<tr>

  <td><p align="center"><img src="images/items/2495.gif"</img><br /> Demon Legs </p></td>

  <td>You see demon legs (Arm:9).

It weighs 54.00 oz.</td>

</tr>


<tr>

  <td><p align="center"><img src="images/items/2195.gif"</img><br /> Boots of haste</p></td>

  <td>You see boots of haste (speed +15).

It weighs 7.50 oz.</td>

</tr>

<tr>

  <td><p align="center"><img src="images/items/2514.gif"</img><br /> Mastermind Shield</p></td>

  <td>You see a mastermind shield (Def:37).

It weighs 57.00 oz.</td>

</tr>

<tr>

  <td><p align="center"><img src="images/items/2520.gif"</img><br /> Demon Shield</p></td>

  <td>You see a demon shield (Def:35).

It weighs 38.00 oz.</td>

</tr>


<tr>

  <td><p align="center"><img src="images/items/2472.gif"</img><br /> Magic Plate Armor</p></td>

  <td>You see a magic plate armor (Arm:17).

It can only be wielded properly by elite knights and royal paladins.

It weighs 85.00 oz.</td>

</tr>


<tr>

  <td><p align="center"><img src="images/items/2470.gif"</img><br /> Golden Legs </p></td>

  <td>You see golden legs (Arm:9).

It can only be wielded properly by elite knights and royal paladins.

It weighs 54.00 oz.</td>

</tr>


<tr>

  <td><p align="center"><img src="images/items/2160.gif"</img><br /> 100 Crystal coins</p></td>

  <td>100,000 Gold.</td>

</tr>


</table>

<br />';

    if(empty($lotterys))

    {

    $main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD CLASS=white><b>Auctions</b></td></TR><TR BGCOLOR='.$config['site']['darkborder'].'><TD>Currently is no one active Auction.</TD></TR></TABLE>';

    $main_content .= '<br /><p align="right"><small></small></p>';

    }

    else

    {

    foreach($lotterys as $lotterys) {

    $players++;

    if(is_int($players / 2))

    $bgcolor = $config['site']['lightborder'];

    else

    $bgcolor = $config['site']['darkborder'];

    $cost = round($auction['cost']/1000, 2);

    $content .= '<TR BGCOLOR='.$bgcolor.'><TD><center>'.$lottery['id'].'</center></TD><TD><center>'.$lottery['item'].'</center></TD><TD><center><a href="?subtopic=characters&name='.urlencode($lottery['name']).'">'.$lottery['name'].'</a></center></TD></TR>';

    }

    $main_content .= 'Os ultimos 20 sorteios:<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD CLASS=white><b><center>ID</center></b></TD><TD class="white"><b><center>Item</center></b></TD><TD class="white"><b><center>Sortudo</center></b></td></TR>'.$content.'</TABLE>';

    $main_content .= '';

}

?>

Pronto?

Editado por WalaceBz (veja o histórico de edições)
Link para o post
Compartilhar em outros sites

Troca o lottery.php por esse ai



<?PHP

//Criado por Dhenyz Shady from shadyroom.blogspot.com

//Favor manter os créditos / Please keep the credits

//Use e abuse / Enjoy!

header("Content-Type: text/html; charset=ISO-8859-1",true) ;

$lotterys = $SQL->query("SELECT `id`, `name`, `item` FROM lottery ORDER BY `id` ASC LIMIT 20;");$players = 0;

$main_content .= ' <h1><center>- '.$config['server']['serverName'].' Lottery System -</center></h1>

Esse sistema sorteia de <b>3 em 3hrs</b> um player <font color="green">ONLINE</font> no servidor para dar um item a ele, e os items disponíveis na loteria são:

<br></br>

<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD CLASS=white><B>Itens Sorteados:</B></TD></TR></TABLE>

<table border="1" width="100%">

<tr>

<td><p align="center"><img src="images/items/2493.gif"</img><br /> Demon Helmet</p></td>

<td>You see a demon helmet (Arm:10).

It weighs 29.50 oz.</td>

</tr>

<tr>

<td><p align="center"><img src="images/items/2494.gif"</img><br /> Demon Armor</p></td>

<td>You see a demon armor (Arm:16).

It weighs 80.00 oz.</td>

</tr>

<tr>

<td><p align="center"><img src="images/items/2495.gif"</img><br /> Demon Legs </p></td>

<td>You see demon legs (Arm:9).

It weighs 54.00 oz.</td>

</tr>


<tr>

<td><p align="center"><img src="images/items/2195.gif"</img><br /> Boots of haste</p></td>

<td>You see boots of haste (speed +15).

It weighs 7.50 oz.</td>

</tr>

<tr>

<td><p align="center"><img src="images/items/2514.gif"</img><br /> Mastermind Shield</p></td>

<td>You see a mastermind shield (Def:37).

It weighs 57.00 oz.</td>

</tr>

<tr>

<td><p align="center"><img src="images/items/2520.gif"</img><br /> Demon Shield</p></td>

<td>You see a demon shield (Def:35).

It weighs 38.00 oz.</td>

</tr>


<tr>

<td><p align="center"><img src="images/items/2472.gif"</img><br /> Magic Plate Armor</p></td>

<td>You see a magic plate armor (Arm:17).

It can only be wielded properly by elite knights and royal paladins.

It weighs 85.00 oz.</td>

</tr>


<tr>

<td><p align="center"><img src="images/items/2470.gif"</img><br /> Golden Legs </p></td>

<td>You see golden legs (Arm:9).

It can only be wielded properly by elite knights and royal paladins.

It weighs 54.00 oz.</td>

</tr>


<tr>

<td><p align="center"><img src="images/items/2160.gif"</img><br /> 100 Crystal coins</p></td>

<td>100,000 Gold.</td>

</tr>


</table>

<br />';

if(empty($lotterys))

{

$main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD CLASS=white><b>Auctions</b></td></TR><TR BGCOLOR='.$config['site']['darkborder'].'><TD>Currently is no one active Auction.</TD></TR></TABLE>';

$main_content .= '<br /><p align="right"><small></small></p>';

}

else

{

foreach($lotterys as $lotterys) {

$players++;

if(is_int($players / 2))

$bgcolor = $config['site']['lightborder'];

else

$bgcolor = $config['site']['darkborder'];

$cost = round($auction['cost']/1000, 2);

$content .= '<TR BGCOLOR='.$bgcolor.'><TD><center>'.$lottery['id'].'</center></TD><TD><center>'.$lottery['item'].'</center></TD><TD><center><a href="?subtopic=characters&name='.urlencode($lottery['name']).'">'.$lottery['name'].'</a></center></TD></TR>';

}

$main_content .= 'Os ultimos 20 sorteios:<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD CLASS=white><b><center>ID</center></b></TD><TD class="white"><b><center>Item</center></b></TD><TD class="white"><b><center>Sortudo</center></b></td></TR>'.$content.'</TABLE>';

$main_content .= '';

}

?>

Pronto?

Agora só aparece isso la em cima do site quando clica em lottery , e também os itens que ganha no sorteio não está aparecendo no layout de lottery em Os ultimos 20 sorteios.

Link para o post
Compartilhar em outros sites

Eu Editei meu post eu tina rancado a função dele eu acho tenta assim




<?PHP

//Criado por Dhenyz Shady from shadyroom.blogspot.com

//Favor manter os créditos / Please keep the credits

//Use e abuse / Enjoy!

header("Content-Type: text/html; charset=ISO-8859-1",true) ;

$lotterys = $SQL->query("SELECT `id`, `name`, `item` FROM lottery ORDER BY `id` ASC LIMIT 20;");$players = 0;

$main_content .= ' <h1><center>- '.$config['server']['serverName'].' Lottery System -</center></h1>

Esse sistema sorteia de <b>3 em 3hrs</b> um player <font color="green">ONLINE</font> no servidor para dar um item a ele, e os items disponíveis na loteria são:

<br></br>

<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD CLASS=white><B>Itens Sorteados:</B></TD></TR></TABLE>

<table border="1" width="100%">

<tr>

  <td><p align="center"><img src="images/items/2493.gif"</img><br /> Demon Helmet</p></td>

  <td>You see a demon helmet (Arm:10).

It weighs 29.50 oz.</td>

</tr>

<tr>

  <td><p align="center"><img src="images/items/2494.gif"</img><br /> Demon Armor</p></td>

  <td>You see a demon armor (Arm:16).

It weighs 80.00 oz.</td>

</tr>

<tr>

  <td><p align="center"><img src="images/items/2495.gif"</img><br /> Demon Legs </p></td>

  <td>You see demon legs (Arm:9).

It weighs 54.00 oz.</td>

</tr>


<tr>

  <td><p align="center"><img src="images/items/2195.gif"</img><br /> Boots of haste</p></td>

  <td>You see boots of haste (speed +15).

It weighs 7.50 oz.</td>

</tr>

<tr>

  <td><p align="center"><img src="images/items/2514.gif"</img><br /> Mastermind Shield</p></td>

  <td>You see a mastermind shield (Def:37).

It weighs 57.00 oz.</td>

</tr>

<tr>

  <td><p align="center"><img src="images/items/2520.gif"</img><br /> Demon Shield</p></td>

  <td>You see a demon shield (Def:35).

It weighs 38.00 oz.</td>

</tr>


<tr>

  <td><p align="center"><img src="images/items/2472.gif"</img><br /> Magic Plate Armor</p></td>

  <td>You see a magic plate armor (Arm:17).

It can only be wielded properly by elite knights and royal paladins.

It weighs 85.00 oz.</td>

</tr>


<tr>

  <td><p align="center"><img src="images/items/2470.gif"</img><br /> Golden Legs </p></td>

  <td>You see golden legs (Arm:9).

It can only be wielded properly by elite knights and royal paladins.

It weighs 54.00 oz.</td>

</tr>


<tr>

  <td><p align="center"><img src="images/items/2160.gif"</img><br /> 100 Crystal coins</p></td>

  <td>100,000 Gold.</td>

</tr>


</table>

<br />';

        if(empty($lotterys))

        {

        $main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD CLASS=white><b>Auctions</b></td></TR><TR BGCOLOR='.$config['site']['darkborder'].'><TD>Currently is no one active Auction.</TD></TR></TABLE>';

        $main_content .= '<br /><p align="right"><small></small></p>';

        }

        else

        {

        foreach($lotterys as $lotterys) {

        $players++;

        if(is_int($players / 2))

        $bgcolor = $config['site']['lightborder'];

        else

        $bgcolor = $config['site']['darkborder'];

        $cost = round($auction['cost']/1000, 2);

        $content .= '<TR BGCOLOR='.$bgcolor.'><TD><center>'.$lottery['id'].'</center></TD><TD><center>'.$lottery['item'].'</center></TD><TD><center><a href="?subtopic=characters&name='.urlencode($lottery['name']).'">'.$lottery['name'].'</a></center></TD></TR>';

        }

        $main_content .= 'Os ultimos 20 sorteios:<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD CLASS=white><b><center>ID</center></b></TD><TD class="white"><b><center>Item</center></b></TD><TD class="white"><b><center>Sortudo</center></b></td></TR>'.$content.'</TABLE>';

        $main_content .= '';

}

?>

Editado por WalaceBz (veja o histórico de edições)
Link para o post
Compartilhar em outros sites

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo