Jump to content

Recommended Posts

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

srand((float)microtime()*100); 
$stolenGlock = 0;$stolenAK47 = 0;$stolenShotgun = 0;$stolenUzi = 0; 
if($your_kills > $his_kills){ 
  $stolenGlock  = round(($pmp[5]/100)*rand(5, 15), 0); 
  $stolenShotgun = round(($pmp[6]/100)*rand(5, 15), 0); 
  $stolenUzi  = round(($pmp[7]/100)*rand(5, 15), 0); 
  $stolenAK47  = round(($pmp[8]/100)*rand(5, 15), 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(5, 15), 0); 
  $stolenShotgun = round(($pimp[17]/100)*rand(5, 15), 0); 
  $stolenUzi  = round(($pimp[18]/100)*rand(5, 15), 0); 
  $stolenAK47  = round(($pimp[19]/100)*rand(5, 15), 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 help would be great


Link to comment
https://forums.phpfreaks.com/topic/50603-stuck-with-php-upgrade-on-a-rpg-game/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.