Jump to content
php.lv forumi

shop


Gochix
 Share

Recommended Posts

vel viens lugums biedri..

 

ka var uzlikt ta piemeram 

jauzliek, lai parbauda ja status_fire_lord jau ir 1 tad izmet message kkadu, ja ir 0 tad aiziet talak viss ka parasti..

<?php
include ("config.php");
if(isset($_POST['buy'])){
if(isset($_POST['item1'])){
$chaos_points = mysql_query("SELECT points FROM ibf_members WHERE id = $member_id")
or die(mysql_error()); 
while($info = mysql_fetch_array( $chaos_points ))
if ( $info['points'] >= 20 ) {
mysql_query("UPDATE `ibf_members` SET `points` = `points` - 20 WHERE `id` = $member_id");
mysql_query("UPDATE `ibf_members` SET status_fire_lord = 1 WHERE `id` = $member_id"); // Daram kaut ko ar item1
echo "<center><b><font color=green>Pirkums veiksmīgs!</font></b></center>";
}else{
echo "<center><b><font color=red>Nepietiekami Chaos pointi!</font></b></center>";
}
}
}
?>
Link to comment
Share on other sites

Es tik nesaprotu, kāda vella pēc tu mēģini uztaisīt kautkādu spēlīti pats, ja no programmēšanas neko nesaproti?

Šis vīrs te kaut ko cenšas mācīties, pie tam dara to reti sakarīgā formā, nevis kā kaut kādi citi lohi.

 

Re, tu jau pats atbildēji, kurā brīdī tev to pārbaudi vajag. Tad pakustini vēl nedaudz galvu un tur arī liec.

Link to comment
Share on other sites

> Šis vīrs te kaut ko cenšas mācīties, pie tam dara to reti sakarīgā formā, nevis kā kaut kādi citi lohi.

 

Šis vīrs iespaidīgi daudz arī zina, spriežot pēc Project Euler.

Link to comment
Share on other sites

kaut ko viņš negrib palaist mani..

<?php
include ("config.php");
if(isset($_POST['buy'])){
if(isset($_POST['item1'])){
$chaos_points = mysql_query("SELECT * FROM ibf_members WHERE id = $member_id")
or die(mysql_error()); 
while($info = mysql_fetch_array( $chaos_points ))
if ( $info['status_fire_lord'] = 0) {
echo "<center><b><font color=RED>Tu tikko jau nopirki Fire Lord, pagaidi kad tas parādīsies tavā somā vai arī spēlē uzraksti .giveitems un tad nāc atpakaļ un pasūti velreiz ;)</font></b></center>";
}
elseif ( $info['points'] >= 20) {
mysql_query("UPDATE `ibf_members` SET `points` = `points` - 20 WHERE `id` = $member_id");
mysql_query("UPDATE `ibf_members` SET status_fire_lord = 1 WHERE `id` = $member_id"); // Daram kaut ko ar item1
echo "<center><b><font color=green>Pirkums veiksmīgs!</font></b></center>";
}else{
echo "<center><b><font color=red>Nepietiekami Chaos pointi!</font></b></center>";
}
}
}
?>


uzliekot if ( $info['status_fire_lord'] = 0) { tad viņš mani palaiž tālāk un lauj nopirkt, bet uzliekot if ( $info['status_fire_lord'] = 1) {

tad uzreiz izmet echo ta itka es butu nopircis, skatijos ieksh db tur staav 0..

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...