Menu

#7 a custom weapon shop

open-accepted
nobody
None
1
2003-10-29
2003-10-29
Kyle Muir
No

This allows you to get a weapon with # amount of
attack, by using this script people can custom build
there weapons at $1000 per attack point.

<?php $title = "Armory"; include("header.php"); ?>

Welcome to the Armory. This is not the normal shop, I
am a blacksmith. Im not making anything with special
names, I'll just make you some equipment, for 1000 cash
for every point of power. Yeah, kid, steel isnt that easy
to come by around here, y'know.

<form method=post action=shop.php?action=buy>
Make me a +<input type=text name=plus size=5>
<select name=eq><option
value=A>Armor</option><option
value=W>Weapon</option></select>. <input
type=submit value=Smith>
</form>

<?php
if ($action == buy) {
if ($plus <= 0) {
print "You know I can't make that.";
include("footer.php");
exit;
}
$cneed = ($plus * 1000);
if ($stat[cash] < $cneed) {
print "You don't have enough cash.";
include("footer.php");
exit;
}
if ($eq == A) {
$cost = ($cneed / 3);
mysql_query("insert into equipment
(owner,name,power,type,cost) values($stat
[id],'Blacksmith Plate',$plus,'$eq',$cost)") or die("Could
not add.");
print "You got a new <b>+$plus</b>
Armor.";
}
if ($eq == W) {
$cost = ($cneed / 3);
mysql_query("insert into equipment
(owner,name,power,type,cost) values($stat
[id],'Blacksmith Blade',$plus,'$eq',$cost)") or die("Could
not add.");
print "You got a new <b>+$plus</b>
Weapon.";
}
mysql_query("update players set cash=cash-
$cneed where id=$stat[id]");
}
?>

<?php include("footer.php"); ?>

This adds lots of creativity as you do not know how
strong someones weapon is.

Happy playing!

Discussion

  • Matt Evans

    Matt Evans - 2003-10-29
    • priority: 5 --> 1
    • status: open --> open-accepted
     
  • Zhamel

    Zhamel - 2003-11-07

    Logged In: YES
    user_id=863803

    Hmm. This looks almost exactly like the weapon shop script
    from the Silent Stalkers code...

     
  • Nobody/Anonymous

    Logged In: NO

    Hmmm . . . .

    This code has many flaws to it, for example most people still
    have credits called credits not cash, i will recode this and
    post it again soon for people that couldnt read this guys one.

    - DP -

     
  • Nobody/Anonymous

    Logged In: NO

    the scrupt does not work

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.