Jump to content
MakeWebGames

Crime chances


Guest

Recommended Posts

Hello,

Idea taken from

spikereloaded said:
i agree, thats why ours doesn't have a major advantage over non donators. Defiantly tricky to get a good balance.

back on topic, how about a new crimes system, either graphically or more features eg. rough indicator of whether a player would be likely to succeed or not or something similar. They seem a bit plain as they are.

 

This is my first publicly released modification, pretty simple, it adds crime chances on the crimes page

VgKoF.jpg

Also adds a title to the images with the written chance %.

I know it's dead simple but hey, looks good on the page imo. So now how to do it.

criminal.php (Around line 30)

Find the query $q2

Replace

You're unable to view this code.

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

 

With

You're unable to view this code.

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

 

 

criminal.php (Around line 44)

Find the table

Replace

You're unable to view this code.

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

 

 

With

 

You're unable to view this code.

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

 

 

criminal.php (Around line 46)

Find the foreach loop ($crimes as $v)

Replace

You're unable to view this code.

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

 

 

With

 

You're unable to view this code.

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

 

 

Enjoy :)

Link to comment
Share on other sites

Cheers Ian, just what i wanted, although looking at the code I should have tried a little harder myself to work it out haha. Just an idea aswell, for the percent bars, it may be necessary to set their Max width to 100. Otherwise you may get some extremely long bars depending on your crime success formula's. That was an issue I had but was solved by assigning the images a class and specifying the max width in the css.

Thanks again Ian

Link to comment
Share on other sites

Cheers Ian, just what i wanted, although looking at the code I should have tried a little harder myself to work it out haha. Just an idea aswell, for the percent bars, it may be necessary to set their Max width to 100. Otherwise you may get some extremely long bars depending on your crime success formula's. That was an issue I had but was solved by assigning the images a class and specifying the max width in the css.

Thanks again Ian

I thought as it was a percentage out of 100 so the max width from both bars in total would be 100%

Link to comment
Share on other sites

I suppose this may be the case for most people, but our crime formulas have been changed quite a bit and at the moment some of them are coming out with success rates of over 100%. Not ideal but something we'll look into! Just thought setting a max width would just be a fail safe incase formulas were changed.

Link to comment
Share on other sites

why not just try:

You're unable to view this code.

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

 

Because that would be the wrong variable to check, since it will be negative if $chance if above 100.

 

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

hey

I

Hello,

Idea taken from

 

 

This is my first publicly released modification, pretty simple, it adds crime chances on the crimes page

VgKoF.jpg

Also adds a title to the images with the written chance %.

I know it's dead simple but hey, looks good on the page imo. So now how to do it.

criminal.php (Around line 30)

Find the query $q2

Replace

You're unable to view this code.

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

With

You're unable to view this code.

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

 

criminal.php (Around line 44)

Find the table

Replace

You're unable to view this code.

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

 

With

 

You're unable to view this code.

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

 

criminal.php (Around line 46)

Find the foreach loop ($crimes as $v)

Replace

You're unable to view this code.

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

 

With

 

You're unable to view this code.

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

 

Enjoy :)

Nice mid but that bar doesn't look right
Link to comment
Share on other sites

  • 3 months 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...