Welcome to Welcome to DNF.com™ - Domain Sales, Domain Forum, Domain Appraisals, Domain Registrars

If you are new to domains and looking to buy, sell and learn about domains then you have come to the right place. DNForum is the largest domain name community on the internet and continues to grow every day. There are over 105,000 domainers on DNForum doing everything from buying domains, selling domains, learning about domains and discussing domains. Take a minute and Register.

Register Today on DNForum IT'S FREE!

Results 1 to 4 of 4
  1. #1
    Gold Lifetime Member
    alcapone's Avatar
    Join Date
    Feb 2005
    Posts
    14
    DNF$
    320
    Bank
    0
    Total DNF$
    320
    Donate  

    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

  2. #2
    DNF Addict
    jdk's Avatar
    Join Date
    Jul 2004
    Location
    Florida
    Posts
    7,082
    Country

    United States
    DNF$
    1,163
    Bank
    0
    Total DNF$
    1,163
    Donate  

    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.

  3. #3
    Gold Lifetime Member
    alcapone's Avatar
    Join Date
    Feb 2005
    Posts
    14
    DNF$
    320
    Bank
    0
    Total DNF$
    320
    Donate  

    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

  4. #4
    DNF Addict
    jdk's Avatar
    Join Date
    Jul 2004
    Location
    Florida
    Posts
    7,082
    Country

    United States
    DNF$
    1,163
    Bank
    0
    Total DNF$
    1,163
    Donate  

    Re: stuck with php upgrade on a rpg game

    I'll try and look tomorrow. I am going to bed.

Similar Threads

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

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Domain name forum recommended by Domaining.com