Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[Release] Fame Command

Status
Not open for further replies.
om nom nom.
Loyal Member
Joined
Nov 30, 2007
Messages
299
Reaction score
9
I dont know whether this was previously released, but here you go.

else if(strcmp(command, "fame") == 0){
player->setFame(player->getFame()+strval(strtok_s(NULL, " ",&next_token)));
}

Im trying to find out how to make the command give fame to another person, for example:

!fame user 10

However ive been failing miserably, any coders that have an idea please post :)
As i would like to implement this myself.
 
Newbie Spellweaver
Joined
Apr 14, 2008
Messages
37
Reaction score
0
PHP:
		else if(strcmp(command, "fame2") == 0){
			for (unsigned int x=0; x<Maps::info[player->getMap()].Players.size(); x++){
					Player* fameme;
					fameme = Maps::info[player->getMap()].Players[x];
					if(fameme != player){
						fameme->setFame(fameme->getFame()+strval(strtok_s(NULL, " ",&next_token)));
					}
				}
		}
This should work. I haven't tested it yet. Both the users has to be in the same map.
 
Newbie Spellweaver
Joined
Jun 2, 2007
Messages
15
Reaction score
0
nice one,
if u want to add some one else fame, i tried to make script for u,
here wat i got (untested but suppose to be working)

else if(strcmp(command, "fame") == 0){
if(strlen(next_token) > 0) {
char *name = strtok_s(NULL, " ",&next_token);
if (strlen(next_token) > 0)
{
int ammount = strval(strtok_s(NULL, " ", &next_token));
if (strcmp(name, "me") == 0) {
printf("%s added him self Fame [%d]\n", player->getName(), ammount);
player->setFame(player->getFame()+ammount);
}
else for (hash_map <int, Player*>::iterator iter = Players::players.begin(); iter != Players::players.end(); iter++)
if (strcmp(iter->second->getName(), name) == 0) {
printf("%s added to %s Fame [%d]\n", player->getName(), name, ammount);
iter->second->setFame(iter->second->getFame()+ammount);
}
}
}
}

(Thx to coNsept my friend that teach me alot =] )
 
om nom nom.
Loyal Member
Joined
Nov 30, 2007
Messages
299
Reaction score
9
nice one,
if u want to add some one else fame, i tried to make script for u,
here wat i got (untested but suppose to be working)



(Thx to coNsept my friend that teach me alot =] )


Works great!
 
Newbie Spellweaver
Joined
May 3, 2008
Messages
92
Reaction score
0
players.cpp =.= Right before a GM command
Don't revive old threads -_-
 
Newbie Spellweaver
Joined
Dec 23, 2008
Messages
55
Reaction score
7
You shoulld also mention the fact that this is a TITAN source NOT ODIN source... people if you cant find any .cpp files then you are more than likely using odin source which is java scripting (.jar .java etc) Titan uses C & C++ scripting(.cpp etc)
 
Status
Not open for further replies.
Back
Top