Jump to content
MakeWebGames

[V2] Mod request! Achievements and country flag.


kingsaint

Recommended Posts

I am looking for somebody who already has or can create me 2 modifications:

One the achievement modification where players can complete certain achievements such as kill 50 players or kill 100 players and receive an achievement, id also like to be able to add to this so if in the future i want to add achievements i can.

Id also like on the user profile page a country flag, so you would see near the user info "Country:(picture of flag)" and id like this to autodetect country and assign the flag by checking the ip address =]

please could anybody who has or can code this for me get in touch =]

Link to comment
Share on other sites

"i want to add achievements i can." You won't be able to, you would need to program them yourself in.

Not true depending on the set up.

Using a database you can have a table for achievements. State an achievement type, money, level, stats, kills etc, then have a column for the value needed. 100 kills, level 100, etc.

then you just run code to check if a player had completed any of these, if they have credit them the achievement.

Because of the setup then, the owner can add more achievements through the staff panel, as long as you have enough different achievement types covered.

[MENTION=68472]kingsaint[/MENTION] I could do the achievement one, as for the country flag, with a bit of googling I might be able to do that. But as I'm almost at release of my own game I need to know if it'll be worth my time to put it plainly

Edited by Coly010
Link to comment
Share on other sites

Not true depending on the set up.

Using a database you can have a table for achievements. State an achievement type, money, level, stats, kills etc, then have a column for the value needed. 100 kills, level 100, etc.

then you just run code to check if a player had completed any of these, if they have credit them the achievement.

Because of the setup then, the owner can add more achievements through the staff panel, as long as you have enough different achievement types covered.

@kingsaint I could do the achievement one, as for the country flag, with a bit of googling I might be able to do that. But as I'm almost at release of my own game I need to know if it'll be worth my time to put it plainly

Country flag is just IP -> Country simple enough.

True but still those achievements are limited, think about other plugins the guy may have, but you solution I guess would work for the basics.

Link to comment
Share on other sites

Country flag is just IP -> Country simple enough.

True but still those achievements are limited, think about other plugins the guy may have, but you solution I guess would work for the basics.

so something like this will work? if i download all the correct flag images etc.......

 

<?php 

require_once('CountryFromIP.inc.php'); 

$ip ='202.164.32.81'; 
//$ip ='210.25.55.2'; 

$object = new CountryFromIP(); 

$countryName = $object->GetCountryName($ip); 
$flagPath = $object->ReturnFlagPath(); 

echo "<BR> <B>Country: </B>".$countryName; 
echo "<BR> <B>Flag: </B> <img src=".$flagPath." border='0'>"; 
?>

 

I basically want to use the flags located here https://www.flag-sprites.com/

Edited by kingsaint
Link to comment
Share on other sites

Why don't you just have the user pick the country they are from? If they have to hide behind a proxy then your logic doesn't work. IP is one of the worst ways to get a persons location because of some strict country laws and blacklists. It's just like IP banning someone, they can easily come back to your game via proxy unless you ban all proxy servers which in turn is also a bad idea because ultimately that may lead to loss of income by big ballers living in a country that hates the country your game is hosted in.

The easiest way is just to have your user pick where they are actually from, and if they lie, WGAF? Chances are you will never know either way lol

For modular achievements, that can be a daunting task at hand. You would have to set something up like with Dave's ajax chat system that hooks into all columns in your table(s) so every time you create a new column it loads automatically which really isn't that daunting really now that I keep thinking about it and just create a function/method (which ever way you choose) to credit the achievement and validate they do/don't have the achievement already. You can also just serialize the requirements much like Dave does with his chat or MCC's item system

Link to comment
Share on other sites

Why don't you just have the user pick the country they are from? If they have to hide behind a proxy then your logic doesn't work. IP is one of the worst ways to get a persons location because of some strict country laws and blacklists. It's just like IP banning someone, they can easily come back to your game via proxy unless you ban all proxy servers which in turn is also a bad idea because ultimately that may lead to loss of income by big ballers living in a country that hates the country your game is hosted in.

The easiest way is just to have your user pick where they are actually from, and if they lie, WGAF? Chances are you will never know either way lol

For modular achievements, that can be a daunting task at hand. You would have to set something up like with Dave's ajax chat system that hooks into all columns in your table(s) so every time you create a new column it loads automatically which really isn't that daunting really now that I keep thinking about it and just create a function/method (which ever way you choose) to credit the achievement and validate they do/don't have the achievement already. You can also just serialize the requirements much like Dave does with his chat or MCC's item system

 

Thanks for all help guys ive managed to add flag system to the game =] (Y)

Link to comment
Share on other sites

Like kyle said let the user choose there nationality/Flag upon sign up and then fetch there result from a table ? Much much easier than your auto_ip file :)

How about a combination of the 2 methods? Let new users sign up with their flag, create an option in preferences.php to allow users to select a flag, meodify existing fields with a quick select and update

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