|
Score System in Infusion einbauen
|
|
| Schrank |
Geschrieben am 16.05.2010 00000005 16:07
|
|
Jung Mitglied ![]() Beiträge: 38 Registriert am: 27.09.08 Fusioneer: 17 years 0 months 4 weeks 29 days 18 hours 43 minutes 2 seconds |
Hallo, ich habe ein Problem. Ich habe ein so genanntes Diebspiel für PHP-Fusion. Nun möchte ich das man nicht nur einen Punkt im Diebspiel bekommt, sondern auch einen Score. Ich habe es nun sehr lange probiert, bekomme es aber leider nicht hin. Ich habe hier unten nun die Datei angehängt, auf der der Gast landet. Dort wird er dann "bestohlen". Nun müsste der Dieb nur noch einen Score bekommen und alles wäre gut. :) Wäre super wenn mir damit jemand helfen könnte. [geshi=php]<?php require_once('include/go.php'); if(!isset($_GET['uid']) || !isNum($_GET['uid'])) { fallback('index.php'); } if(iMEMBER && $userdata['user_id']==$_GET['uid']) { fallback('my.php'); } // get php-fusion user $res = dbquery("SELECT user_id, user_name FROM ".DB_USERS." WHERE user_id=".$_GET['uid']." AND user_status=0"); if(!dbrows($res)) { fallback('index.php'); } $user = dbarray($res); // check ip-reload $res = dbquery("SELECT victim_ip, user_id FROM ".AWSI_DB_VICTIMS." WHERE victim_ip='".USER_IP."' AND user_id=".$user['user_id']." AND created_at>=".(time()-$awsi_settings['reload'])); if(dbrows($res)) { fallback('index.php'); } else { dbquery("REPLACE INTO ".AWSI_DB_VICTIMS." SET victim_ip='".USER_IP."', user_id='".$user['user_id']."', created_at='".time()."'"); } // how many points to steal? if($awsi_settings['points_per_steal']>1) { $points = rand(1, $awsi_settings['points_per_steal']); } else { $points = $awsi_settings['points_per_steal']; } // get steal-it user $res = dbquery("SELECT user_id FROM ".AWSI_DB_USERS." WHERE user_id=".$user['user_id']); if(dbrows($res)) { $row = dbarray($res); dbquery("UPDATE ".AWSI_DB_USERS." SET steal_counts=steal_counts+1, steal_points=steal_points+".$points." WHERE user_id=".$user['user_id']); dbquery("UPDATE ".AWSI_DB_STEAL_DAYS." SET steal_counts=steal_counts+1, steal_points=steal_points+".$points." WHERE user_id=".$user['user_id']." AND steal_day=CURDATE()"); if(mysql_affected_rows()==0) { dbquery("INSERT INTO ".AWSI_DB_STEAL_DAYS." SET steal_counts=1, steal_points=".$points.", user_id=".$user['user_id'].", steal_day=CURDATE()"); } } else { dbquery("INSERT INTO ".AWSI_DB_USERS." SET user_id=".$user['user_id'].", steal_counts=1, steal_points=".$points); dbquery("INSERT INTO ".AWSI_DB_STEAL_DAYS." SET user_id=".$user['user_id'].", steal_day=CURDATE(), steal_counts=1, steal_points=".$points); } /**************************************************************************** * GUI */ opentable($locale['awsi_index']); awsi_menu(); echo sprintf($locale['awsi_stolen'], $user['user_name'], $user['user_name']); closetable(); require_once('include/die.php'); ?>[/geshi] |
|
|
|
| SC-Ad-Bot | Advertisement |
| |
| emblinux |
Geschrieben am 16.05.2010 00000005 16:13
|
|
Seiten Administrator ![]() Beiträge: 3813 Registriert am: 04.10.08 Fusioneer: 17 years 0 months 3 weeks 22 days 4 hours 50 minutes 13 seconds |
Schau dir dazu einfach mal den Thread mit dem geldgame an, dort habe ich dazu bereits was geschrieben. Ergo, einfach mal die Suche benutzen.
|
|
|
|
| Springe ins Forum: |
Austria
Czech Republic
Germany
Denmark
Spain
France
Iran
Lithuania
Norway
Poland
Romania
Russia
Sweden
Slovakia
Turkey
United States
United Kingdom











