Jump to content

need help , got another that won't work..attackwon.php


Recommended Posts

I'm trying to add a steal crystals mod to attak won. can someone please tell me what i am doing wrong here?




$stole=(int) (rand($r['money']/500,$r['money']/20));


$randnumer= rand(20,30);

$hosptime = (int) $randnumer;

$loseruser = $r['userid'];

$winneruser = $ir['userid'];

$winnerusername = $ir['username'];

$reasonhosp = 'Attacked by ';

$reasonhosp .= ' $reasonhosp .= $winneruser;

$reasonhosp .= '>';

$reasonhosp .= $winnerusername;

$reasonhosp .= '.';

mysql_query("UPDATE users SET hosptime=$hosptime WHERE userid=$loseruser",$c);

mysql_query("UPDATE users SET hospreason='$reasonhosp' WHERE userid=$loseruser",$c);


print "You beat {$r['username']} and stole \$$stole";



$expperc=(int) ($expgain/$ir['exp_needed']*100);

print " and gained $expperc% EXP!";

mysql_query("UPDATE users SET exp=exp+$expgain,money=money+$stole WHERE userid=$userid",$c);

mysql_query("UPDATE users SET crystals=crystals+$stolec WHERE userid=$userid",$c);

mysql_query("UPDATE users SET hp=1,money=money-$stole WHERE userid={$r['userid']}",$c);

mysql_query("UPDATE users SET crystals=crystals-$stolec WHERE userid={$r['userid']}",$c);

event_add($r['userid'],"{$ir['username']} attacked you and stole $stole, and $stolec crystal(s).",$c);

//event_add($r['userid'],"{$ir['username']} attacked you and stole $stole.",$c);


mysql_query("INSERT INTO attacklogs VALUES('',$userid,{$_GET['ID']},'won',unix_timestamp(),$stole,'$atklog');",$c);


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.

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.

  • Create New...