Jump to content
MakeWebGames

Gangster Legends V1.0.0 - Development Notes


Dayo

Recommended Posts

Gangster Legends V1.0.0

Right i have started development on Gangster legends v1.0.0, the V1.0 release will be aimed at doing the folowing.

  • Adding the needed features ie staff panel
  • Updating the HTML
  • Geting rid of the limited features (ie the crimes/locations)
  • Updating the backend script

Current Features (V0.75)

  • Crimes
  • Grand Theft Auto
  • Smuggling
  • Black Market
  • Casinos
  • Gangs
  • Bank & Money Transfer
  • Mailbox
  • Friend List
  • Traveling
  • Credit Shop + Credit Auction
  • Forum
  • Referal System
  • Prison + Breakout
  • Probably more :)
  • It is secure to my knoladge

I have started development on this but should take a while (like 2-3 months) but if there are any feature requests just post below and if you would like to contribute any modifications i can add just post below and PM me the mod.

Later when my site is up and running you will be able to download the script at http://www.glscript.net as well as modifications. We will also provide a simple support system too. (and maby a more advanced paid service too).

Demo: http://www.glscript.net/demo/

Link to comment
Share on other sites

Done so far

  • Added a few features (bank and property information (free mods by me and jamiee))
  • Updated the HTML in login/register/forgot password/screenshots
  • Started work on the locations (so you can add/remove locations)
Link to comment
Share on other sites

Crimes.php Update

  • crimes.php/_crimes.php code cleaned up (was very fugly/hard to read) (i shrinked the _crimes.php file by 98 Lines (48% smaller!) (you can thurthermore reduce the file by removing the unused line breaks to around 70 lines!))
  • You can edit aspects of the crime from config.php that include
    • Crime Name
    • Crime success text
    • Crime payout (min/max)
    • Crime Exp (min/max)
    • Crime jail time
    • Crime time (time between you can comit one and another)

Edited by Dayo
Link to comment
Share on other sites

Bug Fixes

- In the Auto Theft it wouldent let you steal a car and came up with an error saying you couldent steal from a staff member ... this is now fixed

- Fixed a small bug in the crimes where after you reached 75% it wouldent let you do the 1st crime

If you find any more please tell me via sending a help desk report or emailing me @ [email protected]

thanks,

Dayo

Link to comment
Share on other sites

A few suggestions –

1) Folder stricter e.g. __filname are just includes right? Why not have an includes folder? (General for always included and then a sub folder for those you include now and then). Include all the “always included” with one file making mod creation easier.

2) Hard to read in places download something like netbeans, and use it’s “format” function. Would be quick(ish) and make it a lot easier to understand.

Link to comment
Share on other sites

1) yea that will be done within the next update

2) Im going throgh file by file and recoding most of it as some of it is just usless here is an example :)

Before:

if($_POST['crime'] == "1" ){
if (rand(0,100) <= $crime_information[0]) {
echo "You were successful in pickpocketing somebody. You received $ ".$payout.",- from the crime";
$suc = "yes";
} else {
if (rand(0,3) == "1" ) {
echo "You failed to commit the crime.";
} else {
$jail = "yes";
echo "You failed to commit the crime and the cops caught you.";
}// if random jail.
}// if random crime.
}// crime 1

if($_POST['crime'] == "2" ){
if (rand(0,100) <= $crime_information[1]) {
echo "You were successful in robbing a gas station.<br />You received $ ".$payout.",- from the crime";
$suc = "yes";
} else {
if (rand(0,3) == "1" ) {
echo "You failed to commit the crime.";
} else {
$jail = "yes";
echo "You failed to commit the crime and the cops caught you.";
}// if random jail.
}// if random crime.
}// crime 2

if($_POST['crime'] == "3" ){
if (rand(0,100) <= $crime_information[2]) {
echo "You were successful in robbing a general store. You received $ ".$payout.",- from the crime";
$suc = "yes";
} else {
if (rand(0,3) == "1" ) {
echo "You failed to commit the crime.";
} else {
$jail = "yes";
echo "You failed to commit the crime and the cops caught you.";
}// if random jail.
}// if random crime.
}// crime 3

if($_POST['crime'] == "4" ){
if (rand(0,100) <= $crime_information[3]) {
echo "You were successful in robbing a federal bank. You received $ ".$payout.",- from the crime";
$suc = "yes";
} else {
if (rand(0,3) == "1" ) {
echo "You failed to commit the crime.";
} else {
$jail = "yes";
echo "You failed to commit the crime and the cops caught you.";
}// if random jail.
}// if random crime.
}// crime 4

if($_POST['crime'] == "5" ){
if (rand(0,100) <= $crime_information[4]) {
echo "You were successful in robbing a casino. You received $ ".$payout.",- from the crime";
$suc = "yes";
} else {
if (rand(0,3) == "1" ) {
echo "You failed to commit the crime.";
} else {
$jail = "yes";
echo "You failed to commit the crime and the cops caught you.";
}// if random jail.
}// if random crime.
}// crime 5

After:

if (in_array($_POST['crime'], array(1, 2, 3, 4, 5, 6))) {
if (rand(0, 100) <=$crime_information[($_POST['crime']-1)]) {
$suc="yes";
echo str_replace('{money}', $payout, $crime_success_text[$_POST['crime']]);
} else if (rand(1, 3)==1) {
$jail="yes";
echo "You failed to commit the crime and the cops caught you.";
} else {
echo "You failed to commit the crime.";
}
}
Link to comment
Share on other sites

1) yea that will be done within the next update

2) Im going throgh file by file and recoding most of it as some of it is just usless here is an example :)

Before:

if($_POST['crime'] == "1" ){
if (rand(0,100) <= $crime_information[0]) {
echo "You were successful in pickpocketing somebody. You received $ ".$payout.",- from the crime";
$suc = "yes";
} else {
if (rand(0,3) == "1" ) {
echo "You failed to commit the crime.";
} else {
$jail = "yes";
echo "You failed to commit the crime and the cops caught you.";
}// if random jail.
}// if random crime.
}// crime 1

if($_POST['crime'] == "2" ){
if (rand(0,100) <= $crime_information[1]) {
echo "You were successful in robbing a gas station.<br />You received $ ".$payout.",- from the crime";
$suc = "yes";
} else {
if (rand(0,3) == "1" ) {
echo "You failed to commit the crime.";
} else {
$jail = "yes";
echo "You failed to commit the crime and the cops caught you.";
}// if random jail.
}// if random crime.
}// crime 2

if($_POST['crime'] == "3" ){
if (rand(0,100) <= $crime_information[2]) {
echo "You were successful in robbing a general store. You received $ ".$payout.",- from the crime";
$suc = "yes";
} else {
if (rand(0,3) == "1" ) {
echo "You failed to commit the crime.";
} else {
$jail = "yes";
echo "You failed to commit the crime and the cops caught you.";
}// if random jail.
}// if random crime.
}// crime 3

if($_POST['crime'] == "4" ){
if (rand(0,100) <= $crime_information[3]) {
echo "You were successful in robbing a federal bank. You received $ ".$payout.",- from the crime";
$suc = "yes";
} else {
if (rand(0,3) == "1" ) {
echo "You failed to commit the crime.";
} else {
$jail = "yes";
echo "You failed to commit the crime and the cops caught you.";
}// if random jail.
}// if random crime.
}// crime 4

if($_POST['crime'] == "5" ){
if (rand(0,100) <= $crime_information[4]) {
echo "You were successful in robbing a casino. You received $ ".$payout.",- from the crime";
$suc = "yes";
} else {
if (rand(0,3) == "1" ) {
echo "You failed to commit the crime.";
} else {
$jail = "yes";
echo "You failed to commit the crime and the cops caught you.";
}// if random jail.
}// if random crime.
}// crime 5

 

After:

if (in_array($_POST['crime'], array(1, 2, 3, 4, 5, 6))) {
if (rand(0, 100) <=$crime_information[($_POST['crime']-1)]) {
$suc="yes";
echo str_replace('{money}', $payout, $crime_success_text[$_POST['crime']]);
} else if (rand(1, 3)==1) {
$jail="yes";
echo "You failed to commit the crime and the cops caught you.";
} else {
echo "You failed to commit the crime.";
}
}

Can I suggest you layout out your code like this:

if (bla == bla)
{
   do this code
   if (bla == bla)
   {
       do this code
   }
   else
   {
       bla bla
   }
}

 

It may turn out to be more lines of code, but it's definitely more readable, and easy to understand.

Link to comment
Share on other sites

As i suggested before use an IDE that tabs for you.

<?php

if (in_array($_POST['crime'], array(1, 2, 3, 4, 5, 6))) {
   if (rand(0, 100) <= $crime_information[($_POST['crime'] - 1)]) {
       $suc = "yes";
       echo str_replace('{money}', $payout, $crime_success_text[$_POST['crime']]);
   } else if (rand(1, 3) == 1) {
       $jail = "yes";
       echo "You failed to commit the crime and the cops caught you.";
   } else {
       echo "You failed to commit the crime.";
   }
}
?>

^ done by netbeans for me.

On a positive note, well done. Looking very nice considering the file difference there. :)

Link to comment
Share on other sites

  • 3 weeks later...

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