Cronwerks MCCode/MCCodes Forums

Please login or register.

Login with username, password and session length

News:

After purchasing with us the download link will be delivered to your forum message box.


This forum is now closed and has moved to a new location! Click here to find out why.

AuthorTopic: how to do this  (Read 699 times)

nusa

  • Basic Member
  • *
  • Reputation Power: 13
  • nusa has no influence.
  • Offline Offline
  • Posts: 27
    • View Profile
how to do this
« on: April 19, 2010, 10:03:47 PM »
hello,
anyone here can help me to do this

1. new users will join random gangs.
2. new users protected from being attack.
3. users protected from being attack more than 5 times/day.
4. maximum gang will alow max 20 users.
5. setting range allow to attack with level value 80%~125% from our level (ie. my level 200, so i only can attack users with level 160~250).
6. additional bot people for each level, each bot can (produce $$$, spend money, add armor, add defence, or armor and defence). bot will add little by little/hour.
7. another users cant see valid statistic (except level).
8. gangs allow to declare war to another gangs for 7 days only. after war they will be in peace from war for 2 days. (no one can attack them for 2 days).
9. gangs allow to declare war to gangs with total level arround 80%~125% of their level.
10. cant attack another users if not enemy we war
11. only allow to transfer $$$ to our gang only, but it will take a cost (10% of the value)
12. level could rise if we send our spend our follower (level will increase after a few hours)
13. will not go to hospital if we still have follower.
14. this item could you buy if you in this value level.

i very need this mods.
could you help to make one of them

i`ll pay people who help me
thanks

« Last Edit: April 20, 2010, 02:44:02 AM by nusa »
Logged

JoshuaDams

  • Active Member
  • **
  • Reputation Power: 129
  • JoshuaDams is working their way up.JoshuaDams is working their way up.JoshuaDams is working their way up.
  • Offline Offline
  • Posts: 240
    • MSN Messenger - immortalthug4ever@hotmail.com
    • View Profile
    • WWW
Re: how to do this
« Reply #1 on: April 20, 2010, 12:59:04 AM »
Quote
new users will join random gangs.
in register.php somewhere

$gang = mysql_query("SELECT `gangid` FROM `gangs);
$xx = mysql_num_rows($gang);
$which = mt_rand(1,$xx);

on the INSERT INTO users query find the 0 that it inserts for gangID and enter $which

Done.

---
Quote
2. new users protected from being attack.

To stop new users from being attacked just put this in the attack script

if($odata['daysold'] < 5)
{
echo "You cannot attack this player, they are to new!");
$h->endpage();
exit;
}

Make sure to add it after the $odata query :P

---

Quote
users protected from being attack more than 5 times/day.

ALTER TABLE `users` ADD `dailyattacks` TINYINT(4) NOT NULL;

add into attack.php  where the fight is won and the users are updated.

mysql_query("UPDATE `users` SET `dailyattacks`=`dailyattacks`+1 WHERE `userid`=".$odata['userid']."");

Then below the $odata QUERY near the top add

if($odata['dailyattacks'] > 4)
{
echo "You can only be attacked 5 times per day, this person has already reached their daily limit";
$h->endpage();
exit;
}

Quote
4. maximum gang will alow max 20 users.
There is a column in gangs that determines how many users per gang, you can change from 5 to 20 for start off gangs in the creatgang.php file.

Quote
5. setting range allow to attack with level value 80%~125% from our level (ie. my level 200, so i only can attack users with level 160~250).
Bit more tricky for myself, as I havent worked with original attack script in awhile >,<

Quote
6. additional bot people for each level, each bot can (produce $$$, spend money, add armor, add defence, or armor and defence). bot will add little by little/hour.

Can use crons to increase NPCs stuff, the rest is manipulated in battletent.php

Quote
8. gangs allow to declare war to another gangs for 7 days only. after war they will be in peace from war for 2 days. (no one can attack them for 2 days).

Again, a bit more tricky as I beleive the default mccodes, more than 1 gang can war you at a time, look into the explode/implode functions.

Quote
9. gangs allow to declare war to gangs with total level arround 80~125 of their level.

Would suggest working out the first bit before dabbling with second.

Quote
10. cant attack another users if not enemy we war
$blah = mysql_query("SELECT * FROM `gangswars` WHERE `warDECLARER `=".$ir['gang']." OR `warDECLARED`=".$ir['gang']."");
if(mysql_num_rows($blah < 1)
{
echo "You are not in a war with anyone so you cannot attack anyone";
$h->endpage();
exit;
}
$usergang = mysql_fetch_array($blah);

$wee = mysql_query("SELECT * FROM `gangswars` WHERE `warDECLARER `=".$odata['gang']." OR `warDECLARED`=".$odata['gang']."");
if(!mysql_num_rows($wee))
{
echo "This persons clan is currently not at war with anyone, so you cannot attack them";
$h->endpage();
exit;
}
$og = mysql_fetch_array($wee);

This will stop them from being able to fight if their clan is not in a war with anyone at all, just woke up, i'll have to look at the actual scripts to determine how to go about checking vs the gangs that are at war with them.

Will look at the rest in a few, just some "ideas" to get you started.

Nothing above has been tested, i just woke up saw the posts and wrote a few things out to guide you in the appropriate direction.

nusa

  • Basic Member
  • *
  • Reputation Power: 13
  • nusa has no influence.
  • Offline Offline
  • Posts: 27
    • View Profile
Re: how to do this
« Reply #2 on: April 20, 2010, 02:43:26 AM »
nombor 9 wrong typed, edited

gangs allow to declare war to gangs with total level arround 80% until 125% of their level.

thanks
Logged

nusa

  • Basic Member
  • *
  • Reputation Power: 13
  • nusa has no influence.
  • Offline Offline
  • Posts: 27
    • View Profile
Re: how to do this
« Reply #3 on: April 20, 2010, 05:26:21 AM »
Quote
new users will join random gangs.
in register.php somewhere

$gang = mysql_query("SELECT `gangid` FROM `gangs);
$xx = mysql_num_rows($gang);
$which = mt_rand(1,$xx);

on the INSERT INTO users query find the 0 that it inserts for gangID and enter $which

Done.

---

this is error
i change to

$gang = mysql_query("SELECT `gangid` FROM `gangs'");
$xx = mysql_num_rows($gang);
$which = mt_rand(1,$xx);

then work
but

$db->query("INSERT INTO users (username, login_name, userpass, gang, level, money, crystals, donatordays, user_level, energy, maxenergy, will, maxwill, brave, maxbrave, hp, maxhp, location, gender, signedup, email, bankmoney, lastip, lastip_signup) VALUES( '{$username}', '{$username}', md5('{$_POST['password']}'), $which, 1, $sm, 0, 0, 1, 12, 12, 100, 100, 5, 5, 100, 100, 1, '{$_POST['gender']}', unix_timestamp(), '{$_POST['email']}', -1, '$IP', '$IP')");
$i=$db->insert_id();
$db->query("INSERT INTO userstats VALUES($i, 10, 10, 10, 10, 10)");

users cant join to random gang
it will join the same gang.

** i cant find this :
on the INSERT INTO users query find the 0 that it inserts for gangID and enter $which
so i add gang and $which

i create 2 gangs
but the new users only registered with the same gangs

thanks

Gang Members President Respect Level
azlan gang 6 azlan 100
ami 1 ami2 100
Logged

nusa

  • Basic Member
  • *
  • Reputation Power: 13
  • nusa has no influence.
  • Offline Offline
  • Posts: 27
    • View Profile
Re: how to do this
« Reply #4 on: April 20, 2010, 06:15:24 AM »
nombor 2 error

Quote
$menuhide=1;
$atkpage=1;
include "globals.php";

$_GET['ID'] == (int) $_GET['ID'];
if(!$_GET['ID'])
{
print "WTF you doing, bro?";
$h->endpage();
exit;
}
else if($_GET['ID'] == $userid)
{
print "Only the crazy attack themselves.";
$h->endpage();
exit;
}
if($odata['daysold'] < 5)
{
echo "You cannot attack this player, they are to new!");
$h->endpage();
exit;
}

else if ($ir['hp'] <= 1)
{
print "Only the crazy attack when their unconscious.<br />
<a href='index.php'>Back</a>";
$h->endpage();
exit;
}
else if ($_SESSION['attacklost'] == 1)
{
print "Only the losers of all their EXP attack when they've already lost.<br />
<a href='index.php'>Back</a>";
$_SESSION['attacklost']=0;
$h->endpage();
exit;
}
//get player data
$youdata=$ir;
$q=$db->query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid={$_GET['ID']}");
$odata=$db->fetch_row($q);
$myabbr=($ir['gender']=="Male") ? "his" : "her";
$oabbr=($ir['gender']=="Male") ? "his" : "her";
if($ir['attacking'] && $ir['attacking'] != $_GET['ID'])
{
print "Bad, bad, bad girl.<br />
<a href='index.php'>Back</a>";
$_SESSION['attacklost']=0;
$h->endpage();
exit;
}
if($odata['hp'] == 1)
{
print "This player is unconscious.<br />
<a href='index.php'>&gt; Back</a>";
$h->endpage();
$_SESSION['attacking']=0;
$ir['attacking']=0;
$db->query("UPDATE users SET attacking=0 WHERE userid=$userid");
exit;
}
Logged

JoshuaDams

  • Active Member
  • **
  • Reputation Power: 129
  • JoshuaDams is working their way up.JoshuaDams is working their way up.JoshuaDams is working their way up.
  • Offline Offline
  • Posts: 240
    • MSN Messenger - immortalthug4ever@hotmail.com
    • View Profile
    • WWW
Re: how to do this
« Reply #5 on: April 20, 2010, 06:36:32 AM »
if($odata['daysold'] < 5)
{
echo "You cannot attack this player, they are to new!");
$h->endpage();
exit;
}

pretty sure I said put that after the $odata query .........

nusa

  • Basic Member
  • *
  • Reputation Power: 13
  • nusa has no influence.
  • Offline Offline
  • Posts: 27
    • View Profile
Re: how to do this
« Reply #6 on: April 20, 2010, 09:59:32 AM »
Cannot find "$odata query" in my attack.php
Logged

nusa

  • Basic Member
  • *
  • Reputation Power: 13
  • nusa has no influence.
  • Offline Offline
  • Posts: 27
    • View Profile
Re: how to do this
« Reply #7 on: April 21, 2010, 02:05:54 AM »
nombor 1 success
but i modify to this

Quote
$random = mt_rand(2,4);


nombor 2 working now

but maketextgame forgot to add this (

Quote
if($odata['daysold'] < 5)
{
echo "You cannot attack this player, they are to new!");
$h->endpage();
exit;
}

i have learned something from maketextgame
thanks

« Last Edit: April 21, 2010, 05:10:07 AM by nusa »
Logged

nusa

  • Basic Member
  • *
  • Reputation Power: 13
  • nusa has no influence.
  • Offline Offline
  • Posts: 27
    • View Profile
Re: how to do this
« Reply #8 on: April 21, 2010, 07:56:21 AM »
number 1~4

2 modification working (number 1 and 2)
i`ll pay 10 USD (i still have $5 after undispute , so i`ll send another 5$)
number 3 not work ( gang set max members 5, but i saw ID1 got 11 members)
number 4 dont know

** where to send?


Logged
 


This forum is now closed and has moved to a new location! Click here to find out why.