vue [TUTO] Loterie - Page 3
Kommunauty
Connexion
Inscription

[TUTO] Loterie


Alexou Messages : 2506

$maxtickets = 250; //nombre de tickets

Change le 250 par 80

Pour le reste, voit ça avec qqun d'autre, peux pas t'aider (pour le moment, ptet demain)

samedi 23 mai 2009

combatspace Messages : 125

quequ'un a trouvé ??

mercredi 27 mai 2009

Alexou Messages : 2506

Ah j'avais oublier :P

Pour enlver le 100 et 200 en sélection, c'est simple, tu les enlève du fichier .tpl

      <option value="100">100</option>
      <option value="200">200</option>

Tu supprime ça, et c'est bon.

Je recherche pour le reste

mercredi 27 mai 2009

Howin Messages : 5

moi j'ai un probléme si quelqu'un peut m'aider

Parse error: syntax error, unexpected T_VARIABLE in /usr/export/www/vhosts/funnetwork/hosting/olimpias/loterie.php on line 59

lundi 1 juin 2009

Alexou Messages : 2506

Tu as bien envoyer les requêtes SQL?

Il apparaît où ce message?

Envoie ton fichier Loterie.php (copier/coller dans ta réponse, entre les balises [code] et []

lundi 1 juin 2009

Howin Messages : 5

merci de m'aider =)

[code]<?php

// -----------------------------------------------------------------------------------------------------------

// Loteria creado por SainT

// loteria&#46;php

// http&#58;//www&#46;ogame&#46;ciberpaxi&#46;es

// -----------------------------------------------------------------------------------------------------------

define('INSIDE' , true);

define('INSTALL' , false);

$xnova_root_path = '&#46;/';

include($xnova_root_path &#46; 'extension&#46;inc');

include($xnova_root_path &#46; 'common&#46;' &#46; $phpEx);

$Tiempo = time();

$loteria = gettemplate('loterie_off');

if($Tiempo < $olimpias_config&#91;'Loterie'&#93 {

$Falta = $olimpias_config&#91;'Loterie'&#93;-$Tiempo;

$parse&#91;'usuarios'&#93; = "Il reste "&#46;$Falta&#46;" secondes avant la prochaine loterie&#46;&#46;&#46; Patience !!!";

$lote = parsetemplate( $loteria, $parse);

display ($lote, "Loterie", false, '', true);

} else {

$resto = $Tiempo - $olimpias_config&#91;'Actualisation'&#93;;

$loteria = gettemplate('loterie_body');

$tiempolote = 3600; //temps entre deux loteries (secondes)

$maxtickets = 50; //nombre de tickets

$canxticketm = 10000000000000000000000; //prix d'un ticket en métal

$canxticketc = 5000000000000000000000; //prix d'un ticket en cristal

$canxticketd = 2000000000000000000000; //prix d'un ticket en deutérium

$totaltickets = doquery ("SELECT sum(tickets) as total_tickets FROM {{table}} ",'loterie');

$CantidadTickets = mysql_fetch_array($totaltickets);

$parse&#91;'Cantidad'&#93; = $CantidadTickets&#91;'total_tickets'&#93;;

$parse&#91;'Cantidadf'&#93; = $maxtickets-$CantidadTickets&#91;'total_tickets'&#93;;

$parse&#91;'Cantidadt'&#93; = $maxtickets;

$parse&#91;'Cantidadm'&#93; = pretty_number($canxticketm);

$parse&#91;'Cantidadc'&#93; = pretty_number($canxticketc);

$parse&#91;'Cantidadd'&#93; = pretty_number($canxticketd);

$TusTickets2 = doquery ("SELECT * FROM {{table}} WHERE `user` = '"&#46;$user&#91;'username'&#93;&#46;"' ",'loterie');

$TusTicket3 = mysql_fetch_array($TusTickets2);

$TusTickets=$TusTicket3&#91;'tickets'&#93;;

if($TusTickets != NULL) {

$parse&#91;'tustickets'&#93; = $TusTickets;

}

else {

$parse&#91;'tustickets'&#93; = 0;

}

if($_GET&#91;'cp'&#93; == "compra")

$metal = $_POST&#91;'Tickets'&#93;*$canxticketml

$cristal = $_POST&#91;'Tickets'&#93;*$canxticketc

$Deuterio = $_POST&#91;'Tickets'&#93;*$canxticketd

$complant = doquery("SELECT * FROM {{table}} WHERE `id` = '"&#46;$planetrow&#91;'id'&#93;&#46;"' ",'planets');

$DatosPlaneta = mysql_fetch_array($complant);

if ($DatosPlaneta&#91;'metal'&#93; >= $metal && $DatosPlaneta&#91;'crystal'&#93; >= $cristal && $DatosPlaneta&#91;'deuterium'&#93; >= $Deuterio)

{

if ($parse&#91;'Cantidadf'&#93; < $_POST&#91;'Tickets'&#93 { $parse&#91;'MensajeCompra'&#93; = "<font color='#FF0000'>Il n'y a plus assez de tickets pour en acheter autant !</font>"; } else {

$smetal = $DatosPlaneta&#91;'metal'&#93;-$metal;

$scristal = $DatosPlaneta&#91;'crystal'&#93;-$cristal;

$sdeuterio = $DatosPlaneta&#91;'deuterium'&#93;-$Deuterio;

doquery("UPDATE {{table}} SET `metal`='"&#46;$smetal&#46;"', `crystal`='"&#46;$scristal&#46;"', `deuterium`='"&#46;$sdeuterio&#46;"' WHERE `id`='"&#46;$planetrow&#91;'id'&#93;&#46;"' limit 1", "planets");

if($TusTickets > 0) {

$Suma = $TusTickets+$_POST&#91;'Tickets'&#93;;

doquery("UPDATE {{table}} SET `tickets`='"&#46;$Suma&#46;"' WHERE `user`='{$user&#91;'username'&#93;}' limit 1", "loterie");

} else { doquery("INSERT INTO {{table}} SET `ID`='"&#46;$user&#91;'id'&#93;&#46;"', `user`='"&#46;$user&#91;'username'&#93;&#46;"', `tickets`='"&#46;$_POST&#91;'Tickets'&#93;&#46;"' ", "loterie"); }

$parse&#91;'MensajeCompra'&#93; = "<font color='#00FF00'>Vous avez acheté "&#46;$_POST&#91;'Tickets'&#93;&#46;" Tickets&#46;</font>";

 ?> <META HTTP-EQUIV='Refresh' CONTENT="0; URL='overview&#46;php'> <?

}

if(($_POST&#91;'Tickets'&#93;+$CantidadTickets&#91;'total_tickets'&#93 == $maxtickets) {

$ganador = doquery("SELECT * FROM {{table}} order by rand()", "loterie");

$elganador = mysql_fetch_array($ganador);

$ganad = $elganador&#91;'ID'&#93;;

$userio = doquery("SELECT * FROM {{table}} WHERE `id` = '"&#46;$ganad&#46;"' limit 1",'users');

$Datoswiner = mysql_fetch_array($userio);

$ganadp = $Datoswiner&#91;'id_planet'&#93;;

$complant = doquery("SELECT * FROM {{table}} WHERE `id_owner` = '"&#46;$ganad&#46;"' limit 1",'planets');

$DatosPlaneta = mysql_fetch_array($complant);

$emetal = $DatosPlaneta&#91;'metal'&#93;+($canxticketm*$maxtickets); //gains en métal

$ecristal = $DatosPlaneta&#91;'crystal'&#93;+($canxticketc*$maxtickets); //gains en cristal

$edeuterio = $DatosPlaneta&#91;'deuterium'&#93;+($canxticketd*$maxtickets); //gains en deutérium

doquery("UPDATE {{table}} SET `metal`='"&#46;$emetal&#46;"', `crystal`='"&#46;$ecristal&#46;"', `deuterium`='"&#46;$edeuterio&#46;"' WHERE `id`='"&#46;$ganadp&#46;"' limit 1", "planets");

$dando = doquery("SELECT * FROM {{table}}", "loterie");

$Time = time();

$From = "<font color=""&#46; $kolor &#46;"">Loteries</font>";

$Subject = "<font color=""&#46; $kolor &#46;"">Résultats de la loterie</font>";

$summery=0;

while ($uzer = mysql_fetch_array($dando)) {

if($ganad == $uzer&#91;'ID'&#93 { $Message = "<font color='#00ff00'>Félicitations !!!

Tu as le Ticket gagnant de la loterie !

Nous espérons te revoir bientôt !</font>"; } //Message en cas de gain

else { $Message = "<font color='#FF0000'>

Tu n'as pas acheté le Ticket gagnant,

Nous espérons te revoir bientôt !</font>"; } //Message en cas de perte

SendSimpleMessage ( $uzer&#91;'ID'&#93;, $uzer&#91;'ID'&#93;, $Time, 1, $From, $Subject, $Message);

}

doquery ("DELETE FROM {{table}} ",'loterie');

$sigueintelore = $tiempolote + time();

doquery("UPDATE {{table}} SET `config_value`='"&#46;$sigueintelore&#46;"' WHERE `config_name`='Loterie' limit 1", "config");

}

} else { $parse&#91;'MensajeCompra'&#93; = "<font color='#FF0000'>Tu n'as pas assez de ressources !</font>"; }

}

$pase&#91;'usuarios'&#93; = "Autres joueurs";

if($CantidadTickets == $maxtickets) { $parse&#91;'color'&#93; = "red"; } else { $parse&#91;'color'&#93; = "green"; }

$usuarios = doquery("SELECT * FROM {{table}} order by tickets", "loterie");

while ($listad = mysql_fetch_array($usuarios)) {

$parse&#91;'usuarios'&#93; &#46;= ""&#46;$listad&#91;'user'&#93;&#46;" possède "&#46;$listad&#91;'tickets'&#93;&#46;" Ticket(s)<br/>";

}

$lote = parsetemplate( $loteria, $parse);

display ($lote, "Loterie", false, '', true);

}

// -----------------------------------------------------------------------------------------------------------

// Loteria creado por SainT

// http&#58;//www&#46;ogame&#46;ciberpaxi&#46;es

// -----------------------------------------------------------------------------------------------------------

 ?>[/code:5]

lundi 1 juin 2009

Alexou Messages : 2506

Tu as modifier quelque-chose?

Parce que les fichiers sont pas pareils.

Remplace-le par ça:

[code] <?php

// -----------------------------------------------------------------------------------------------------------

// Loteria creado por SainT

// loteria&#46;php

// http&#58;//www&#46;ogame&#46;ciberpaxi&#46;es

// -----------------------------------------------------------------------------------------------------------

define('INSIDE' , true);

define('INSTALL' , false);

$xnova_root_path = '&#46;/';

include($xnova_root_path &#46; 'extension&#46;inc');

include($xnova_root_path &#46; 'common&#46;' &#46; $phpEx);

$Tiempo = time();

$loteria = gettemplate('loterie_off');

if($Tiempo < $game_config&#91;'Loterie'&#93 {

$Falta = $game_config&#91;'Loterie'&#93;-$Tiempo;

$parse&#91;'usuarios'&#93; = "Il reste "&#46;$Falta&#46;" secondes avant la prochaine loterie&#46;&#46;&#46; Patience !!!";

$lote = parsetemplate( $loteria, $parse);

display ($lote, "Loterie", false, '', true);

} else {

$resto = $Tiempo - $game_config&#91;'Actualisation'&#93;;

$loteria = gettemplate('loterie_body');

$tiempolote = 3600; //temps entre deux loteries (secondes)

$maxtickets = 250; //nombre de tickets

$canxticketm = 100000; //prix d'un ticket en métal

$canxticketc = 50000; //prix d'un ticket en cristal

$canxticketd = 20000; //prix d'un ticket en deutérium

$totaltickets = doquery ("SELECT sum(tickets) as total_tickets FROM {{table}} ",'loterie');

$CantidadTickets = mysql_fetch_array($totaltickets);

$parse&#91;'Cantidad'&#93; = $CantidadTickets&#91;'total_tickets'&#93;;

$parse&#91;'Cantidadf'&#93; = $maxtickets-$CantidadTickets&#91;'total_tickets'&#93;;

$parse&#91;'Cantidadt'&#93; = $maxtickets;

$parse&#91;'Cantidadm'&#93; = pretty_number($canxticketm);

$parse&#91;'Cantidadc'&#93; = pretty_number($canxticketc);

$parse&#91;'Cantidadd'&#93; = pretty_number($canxticketd);

$TusTickets2 = doquery ("SELECT * FROM {{table}} WHERE `user` = '"&#46;$user&#91;'username'&#93;&#46;"' ",'loterie');

$TusTicket3 = mysql_fetch_array($TusTickets2);

$TusTickets=$TusTicket3&#91;'tickets'&#93;;

if($TusTickets != NULL) {

$parse&#91;'tustickets'&#93; = $TusTickets;

}

else {

$parse&#91;'tustickets'&#93; = 0;

}

if($_GET&#91;'cp'&#93; == "compra") {

$metal = $_POST&#91;'Tickets'&#93;*$canxticketml;

$cristal = $_POST&#91;'Tickets'&#93;*$canxticketc;

$Deuterio = $_POST&#91;'Tickets'&#93;*$canxticketd;

$complant = doquery("SELECT * FROM {{table}} WHERE `id` = '"&#46;$planetrow&#91;'id'&#93;&#46;"' ",'planets');

$DatosPlaneta = mysql_fetch_array($complant);

if ($DatosPlaneta&#91;'metal'&#93; >= $metal && $DatosPlaneta&#91;'crystal'&#93; >= $cristal && $DatosPlaneta&#91;'deuterium'&#93; >= $Deuterio)

{

if ($parse&#91;'Cantidadf'&#93; < $_POST&#91;'Tickets'&#93 { $parse&#91;'MensajeCompra'&#93; = "<font color='#FF0000'>Il n'y a plus assez de tickets pour en acheter autant !</font>"; } else {

$smetal = $DatosPlaneta&#91;'metal'&#93;-$metal;

$scristal = $DatosPlaneta&#91;'crystal'&#93;-$cristal;

$sdeuterio = $DatosPlaneta&#91;'deuterium'&#93;-$Deuterio;

doquery("UPDATE {{table}} SET `metal`='"&#46;$smetal&#46;"', `crystal`='"&#46;$scristal&#46;"', `deuterium`='"&#46;$sdeuterio&#46;"' WHERE `id`='"&#46;$planetrow&#91;'id'&#93;&#46;"' limit 1", "planets");

if($TusTickets > 0) {

$Suma = $TusTickets+$_POST&#91;'Tickets'&#93;;

doquery("UPDATE {{table}} SET `tickets`='"&#46;$Suma&#46;"' WHERE `user`='{$user&#91;'username'&#93;}' limit 1", "loterie");

} else { doquery("INSERT INTO {{table}} SET `ID`='"&#46;$user&#91;'id'&#93;&#46;"', `user`='"&#46;$user&#91;'username'&#93;&#46;"', `tickets`='"&#46;$_POST&#91;'Tickets'&#93;&#46;"' ", "loterie"); }

$parse&#91;'MensajeCompra'&#93; = "<font color='#00FF00'>Vous avez acheté "&#46;$_POST&#91;'Tickets'&#93;&#46;" Tickets&#46;</font>";

 ?> <META HTTP-EQUIV='Refresh' CONTENT="0; URL='overview&#46;php'> <?

}

if(($_POST&#91;'Tickets'&#93;+$CantidadTickets&#91;'total_tickets'&#93 == $maxtickets) {

$ganador = doquery("SELECT * FROM {{table}} order by rand()", "loterie");

$elganador = mysql_fetch_array($ganador);

$ganad = $elganador&#91;'ID'&#93;;

$userio = doquery("SELECT * FROM {{table}} WHERE `id` = '"&#46;$ganad&#46;"' limit 1",'users');

$Datoswiner = mysql_fetch_array($userio);

$ganadp = $Datoswiner&#91;'id_planet'&#93;;

$complant = doquery("SELECT * FROM {{table}} WHERE `id_owner` = '"&#46;$ganad&#46;"' limit 1",'planets');

$DatosPlaneta = mysql_fetch_array($complant);

$emetal = $DatosPlaneta&#91;'metal'&#93;+($canxticketm*$maxtickets); //gains en métal

$ecristal = $DatosPlaneta&#91;'crystal'&#93;+($canxticketc*$maxtickets); //gains en cristal

$edeuterio = $DatosPlaneta&#91;'deuterium'&#93;+($canxticketd*$maxtickets); //gains en deutérium

doquery("UPDATE {{table}} SET `metal`='"&#46;$emetal&#46;"', `crystal`='"&#46;$ecristal&#46;"', `deuterium`='"&#46;$edeuterio&#46;"' WHERE `id`='"&#46;$ganadp&#46;"' limit 1", "planets");

$dando = doquery("SELECT * FROM {{table}}", "loterie");

$Time = time();

$From = "<font color=""&#46; $kolor &#46;"">Loteries</font>";

$Subject = "<font color=""&#46; $kolor &#46;"">Résultats de la loterie</font>";

$summery=0;

while ($uzer = mysql_fetch_array($dando)) {

if($ganad == $uzer&#91;'ID'&#93 { $Message = "<font color='#00ff00'>Félicitations !!!

Tu as le Ticket gagnant de la loterie !

Nous espérons te revoir bientôt !</font>"; } //Message en cas de gain

else { $Message = "<font color='#FF0000'>

Tu n'as pas acheté le Ticket gagnant,

Nous espérons te revoir bientôt !</font>"; } //Message en cas de perte

SendSimpleMessage ( $uzer&#91;'ID'&#93;, $uzer&#91;'ID'&#93;, $Time, 1, $From, $Subject, $Message);

}

doquery ("DELETE FROM {{table}} ",'loterie');

$sigueintelore = $tiempolote + time();

doquery("UPDATE {{table}} SET `config_value`='"&#46;$sigueintelore&#46;"' WHERE `config_name`='Loterie' limit 1", "config");

}

} else { $parse&#91;'MensajeCompra'&#93; = "<font color='#FF0000'>Tu n'as pas assez de ressources !</font>"; }

}

$pase&#91;'usuarios'&#93; = "Autres joueurs";

if($CantidadTickets == $maxtickets) { $parse&#91;'color'&#93; = "red"; } else { $parse&#91;'color'&#93; = "green"; }

$usuarios = doquery("SELECT * FROM {{table}} order by tickets", "loterie");

while ($listad = mysql_fetch_array($usuarios)) {

$parse&#91;'usuarios'&#93; &#46;= ""&#46;$listad&#91;'user'&#93;&#46;" possède "&#46;$listad&#91;'tickets'&#93;&#46;" Ticket(s)<br/>";

}

$lote = parsetemplate( $loteria, $parse);

display ($lote, "Loterie", false, '', true);

}

// -----------------------------------------------------------------------------------------------------------

// Loteria creado por SainT

// http&#58;//www&#46;ogame&#46;ciberpaxi&#46;es

// -----------------------------------------------------------------------------------------------------------

 ?>[/code:7]

lundi 1 juin 2009

combatspace Messages : 125

Quelq'un c'est ou on restreint le nombre de tickets ? et ajout de gain de vaisseau ??

lundi 1 juin 2009

Alexou Messages : 2506

Dis ta fini avec ça, tu pourris tous les topics, on sait pas on sait.

On est pas non plus des machines qui passe leurs temps à apprendre juste pour que tu puisse modifier ton jeu.

lundi 1 juin 2009

combatspace Messages : 125

hihi,ba je voulais savoir si le créateur de la loterie avait une reponse

lundi 1 juin 2009

Page suivante »