Jump to content
MakeWebGames

Humans vs. Zombies EVENT mod [done, v1.0]


seanybob

Recommended Posts

Written by Dissobey and Seanybob. Contributions made by various members (Haunted Dawg, POG1)

This is v1.0

If any bugs are found, or new ideas suggested, they may be added to the mod (resulting in, naturally, the version number being updated).

If you like this free mod, check out some of the other free/paid mods I have at my website

What is this mod?

This mod will enable zombies to attack your town. It turns some users into zombies immediately, and everyone they bite turns into a zombie. As time progresses, the humans that are left will get fewer and fewer, and only the strongest will survive. When the event is ended by the admin, the humans who are left surviving get a specified prize, and the zombies with the most kills get prizes.

Now without further ado... the code:

mysql

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

 

Open attack.php

Find

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

After that add

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

 

Create attackbite.php

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

 

Open explore.php

Find

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

After that, add

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

Find

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

Replace with

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

 

Open register.php

Find

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

Replace that line with

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

 

Create file hvzlist.php

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 
Link to comment
Share on other sites

Re: [mccode v2] Humans vs. Zombies EVENT mod [done, v1.0]

Create file hvzadmin.php

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

Open smenu.php

Find

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

Right before it, add

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

Open viewuser.php

Find

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

Before it add

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

Find

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

Before it add

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

Link to comment
Share on other sites

Re: [mccode v2] Humans vs. Zombies EVENT mod [done, v1.0]

 

Is This Right In attack.php

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

no, try this:

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

Link to comment
Share on other sites

Re: [mccode v2] Humans vs. Zombies EVENT mod [done, v1.0]

BUMP because I love it

I installed this a few days ago and Iv been mad busy to look into it but I found:

The 'Bite them' link doesnt display when a user is attacked (Another user was unsure were this went until seany shown them, mine is definetly in the right place). It works if I go direct via URL to the attackbite.php page

When the event is started, it doesnt make X amount of random people a zombie.

The little snippit of code added to viewuser.php displays the wrong amount of kills i.e I had 3 kills so it said I had 3 kills in my profile, but another zombie user had 0 yet it displayed that they had 3 kills.

This is all Iv found so far, people that know me will confirm Im mad busy so once I get a min I'll fix these 'bugs' and post up the cure.

Another well done for everyone that chipped in on this mod

Link to comment
Share on other sites

Re: [mccode v2] Humans vs. Zombies EVENT mod [done, v1.0]

 

The 'Bite them' link doesnt display when a user is attacked (Another user was unsure were this went until seany shown them, mine is definetly in the right place). It works if I go direct via URL to the attackbite.php page

Show the code where you placed it - in my test game, it showed up just fine. Hm...

 

When the event is started, it doesnt make X amount of random people a zombie.

Again, worked in my test game. Possible reason for error is that there is not a row inserted in the hvzstats table. Put this at the top of a page (say, explore.php) and let me know what it outputs:

$ztestnum=$db->num_rows($db->query("SELECT * FROM hvzstats"));

print"Tell Seanybob the number: " . $ztestnum;

 

The little snippit of code added to viewuser.php displays the wrong amount of kills i.e I had 3 kills so it said I had 3 kills in my profile, but another zombie user had 0 yet it displayed that they had 3 kills.

You're right. The line of code in question is this:

if($r['humanorzombie'] == 1) { $zomb="<font color='red'>Zombie</font>";$kills= "Kills: <font color='red'> {$ir['zombiekills']}</font>

";}

Should be

if($r['humanorzombie'] == 1) { $zomb="<font color='red'>Zombie</font>";$kills= "Kills: <font color='red'> {$r['zombiekills']}</font>

";}

Link to comment
Share on other sites

Re: [mccode v2] Humans vs. Zombies EVENT mod [done, v1.0]

 

The 'Bite them' link doesnt display when a user is attacked (Another user was unsure were this went until seany shown them, mine is definetly in the right place). It works if I go direct via URL to the attackbite.php page

Show the code where you placed it - in my test game, it showed up just fine. Hm...

 

When the event is started, it doesnt make X amount of random people a zombie.

Again, worked in my test game. Possible reason for error is that there is not a row inserted in the hvzstats table. Put this at the top of a page (say, explore.php) and let me know what it outputs:

$ztestnum=$db->num_rows($db->query("SELECT * FROM hvzstats"));

print"Tell Seanybob the number: " . $ztestnum;

 

The little snippit of code added to viewuser.php displays the wrong amount of kills i.e I had 3 kills so it said I had 3 kills in my profile, but another zombie user had 0 yet it displayed that they had 3 kills.

You're right. The line of code in question is this:

if($r['humanorzombie'] == 1) { $zomb="<font color='red'>Zombie</font>";$kills= "Kills: <font color='red'> {$ir['zombiekills']}</font>

";}

Should be

if($r['humanorzombie'] == 1) { $zomb="<font color='red'>Zombie</font>";$kills= "Kills: <font color='red'> {$r['zombiekills']}</font>

";}

$ztestnum=$db->num_rows($db->query("SELECT * FROM hvzstats"));

print"Tell Seanybob the number: " . $ztestnum;

outputted 1

My bite them link doesn't show up either:

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

Link to comment
Share on other sites

Re: [mccode v2] Humans vs. Zombies EVENT mod [done, v1.0]

 

My bite them link doesn't show up either:

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

so gurpeet, something is wrong with this conditional...

if ($ir['humanorzombie'] == 1 && $odata['level'] >= $ir['level'] && $odata['humanorzombie']==0)

Not sure if extra parentheticals are needed to change order of operations...

if (($ir['humanorzombie'] == 1 && $odata['level']) >= ($ir['level'] && $odata['humanorzombie']==0))

$ir is a global variable that should be set. $odata should be set right before this code, since you are outputting $odata['username']. Try outputting each of the 4 variables in the if statement, let me know what the output is. Chances are one of them are null for some reason.

Link to comment
Share on other sites

Re: [mccode v2] Humans vs. Zombies EVENT mod [done, v1.0]

 

Sean, You should make it so once someone is bitten they can't be bitten again.

It would make everyone compete more lol

This should already be in effect, if I understand you... zombies can only bite humans, and when they do bite a human that human turns into a zombie - so they cannot bite that person again. Did I misunderstand?

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.

Guest
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...