It appears you have not yet registered with our community. To register please click here...

DNforum.com - Domain Sales, Domain Forum, Domain Appraisals
 
Register Now!
Register Now for FREE!
Our records show you have not yet registered to our forums. To sign up for your FREE account INSTANTLY fill out the form below!

Username: Password: Confirm Password: E-Mail: Confirm E-Mail:  
Birthday:       I agree to forum rules 

Go Back   DNForum - Domain Sales, Domain Forum, Domain Appraisals, Domain Registrars > Content Development > Website Development and Design Discussion > Coding/Programming/Languages
Reply
 
LinkBack Thread Tools Display Modes
Old 05-08-2007, 10:49 PM   #1 (permalink)
Gold Lifetime Member
 
alcapone's Avatar
 
Last Online: 09-16-2008 02:36 AM
iTrader: (1)
Join Date: Feb 2005
Posts: 14
DNF$: 127


stuck with php upgrade on a rpg game

hello there im looking for any help i can get with this i added this part of the script to my attack script were you will steal the other players guns as well as attack if you win when you attack if not they steal your weapons i have it so they show up when you win bu it dont take the guns away from the other player here is what was added
PHP Code:
srand((float)microtime()*100);
 
$stolenGlock 0;$stolenAK47 0;$stolenShotgun 0;$stolenUzi 0;
 if(
$your_kills $his_kills){
  
$stolenGlock  round(($pmp[5]/100)*rand(515), 0);
  
$stolenShotgun round(($pmp[6]/100)*rand(515), 0);
  
$stolenUzi  round(($pmp[7]/100)*rand(515), 0);
  
$stolenAK47  round(($pmp[8]/100)*rand(515), 0);
  
  
$query sprintf("UPDATE %s SET glock=glock+%s, shotgun=shotgun+%s, uzi=uzi+%s, ak47=ak47+%s WHERE id=%s",
       
$tab["pimp"], $stolenGlock$stolenShotgun$stolenUzi$stolenAK47$id);
  
mysql_query($query);
 
$query sprintf("UPDATE %s SET glock=glock-%s, shotgun=shotgun-%s, uzi=uzi-%s, ak47=ak47-%s WHERE pimp=%s",
       
$tab["pimp"], $stolenGlock$stolenShotgun$stolenUzi$stolenAK47$pid);
  
mysql_query($query);
 }else{
  
$stolenGlock  round(($pimp[16]/100)*rand(515), 0);
  
$stolenShotgun round(($pimp[17]/100)*rand(515), 0);
  
$stolenUzi  round(($pimp[18]/100)*rand(515), 0);
  
$stolenAK47  round(($pimp[19]/100)*rand(515), 0);
  
  
$query sprintf("UPDATE %s SET glock=glock+%s, shotgun=shotgun+%s, uzi=uzi+%s, ak47=ak47+%s WHERE pimp=%s",
       
$tab["pimp"], $stolenGlock$stolenShotgun$stolenUzi$stolenAK47$pid);
  
mysql_query($query);
  
$query sprintf("UPDATE %s SET glock=glock-%s, shotgun=shotgun-%s, uzi=uzi-%s, ak47=ak47-%s WHERE id=%s",
       
$tab["pimp"], $stolenGlock$stolenShotgun$stolenUzi$stolenAK47$id);
  
mysql_query($query);
 }
 
?> 

now when you attack some one this is what it will say

you killed 1,111 ( 100 thugs 1,011 hitmen 0 bodyguards ) of rocky 's boys in the attack.
your 960 were killed ( 0 thugs 0 hitmen 960 bodyguards )

you ganked $ 80 from rocky 's dead thugs.
you also stole 414 AK47s, 502 glocks, 0 shotguns and 0 uzis

and it will add the guns to me after the attack but it dont take them away from the player i attack
i beleive the problem is some were in the - part of the code any helpwould be great
alcapone is offline   Reply With Quote
Sponsored Links
Old 05-08-2007, 11:27 PM   #2 (permalink)
jdk
DNF Addict
 
jdk's Avatar
 
Name: Doug
Last Online: Today 01:22 AM
iTrader: (152)
Join Date: Jul 2004
Posts: 6,180
DNF$: 58,011
Location: South Florida
Country:


Re: stuck with php upgrade on a rpg game

Make sure $pmp[5], [6], [7], [8] and $pimp[16],[17],[18],[19] match up to the proper fields in your mysql query where you get the values.

The problem is many people are copying a piece of code here or there from other games and sometimes their queries are not in the same order or do not correspond to the same values.

I have had to fix problems like this recently on many games.

Hope this helps.
jdk is offline   Reply With Quote
Old 05-08-2007, 11:46 PM   #3 (permalink)
Gold Lifetime Member
 
alcapone's Avatar
 
Last Online: 09-16-2008 02:36 AM
iTrader: (1)
Join Date: Feb 2005
Posts: 14
DNF$: 127


Re: stuck with php upgrade on a rpg game

i checked that thats all good im really stumped on this one i mean they will add to you if you hit someone but wont take them away you see anything with the code that might not be right
alcapone is offline   Reply With Quote
Old 05-09-2007, 01:01 AM   #4 (permalink)
jdk
DNF Addict
 
jdk's Avatar
 
Name: Doug
Last Online: Today 01:22 AM
iTrader: (152)
Join Date: Jul 2004
Posts: 6,180
DNF$: 58,011
Location: South Florida
Country:


Re: stuck with php upgrade on a rpg game

I'll try and look tomorrow. I am going to bed.
jdk is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
gamejerseys.com Golom Domain Name Appraisal Discussion 4 02-18-2007 09:03 PM
Surpluses.net any name 25.00 DomainTurn.com Domains for Sale (Domain Sales) - Fixed Prices Above $100 0 01-06-2007 11:24 PM
Digitablet.com etc..... picassoface Domains for Sale (Domain Sales) - Offers Wanted 0 12-14-2006 06:05 AM
Spin for Free - Wheel of Domains Game - Lots of Yahoo Domains for Sale nameplanet Domains for Sale (Domain Sales) - Fixed Prices Above $100 22 01-31-2005 04:15 PM
a nice one: mysqlphp.com Domain Name Appraisal Discussion 2 04-27-2002 05:29 PM


All times are GMT -4. The time now is 03:04 AM.
Copyright @2001-2008 DNForum.com

Learn Domains
Promote Domains
Research Domains
Buy Domains
Resell Domains
Park Domains
Sell Domains
Build Domains
Host Domains
Trademark Domains
Domain Domains
manage Domains
Appraise Domains