Jump to content
  • 0

@adjgm ( adjust GM lvl in game )


awesomazingxed

Question


  • Group:  Members
  • Topic Count:  51
  • Topics Per Day:  0.01
  • Content Count:  95
  • Reputation:   0
  • Joined:  10/24/14
  • Last Seen:  

Hello everyone, can someone help me with this. 

Everytime i use this command toward players, it keeps saying "Player is not online or does not exist"

Eventhough they're online and the name is correct. Anyone knows?

Thanks in advance. Ciao!  /lv

/*=========================================================
@adjgm command
by Missingno
===========================================================
Idea: http://goo.gl/8mcFke
===========================================================
Description:
Permanently adjusts a target player's GM group via 
atcommand.
===========================================================
Compatibility:
Optimised for rAthena emulators.
===========================================================
Changelog:
v1.0 - First version.
=========================================================*/

-	script	adjgm	-1,{

	OnInit:
		bindatcmd "adjgm", strnpcinfo(0) +"::OnAtcommand", 99, 99;
		end;
		
		
	OnAtcommand:
		// Check for proper input
		if (.@atcmd_numparameters < 2) {
			message strcharinfo(0), "Invalid syntax (usage: "+ .@atcmd_command$ +" <group id> <player name>).";
			message strcharinfo(0), .@atcmd_command$ +" failed.";
			end;
		}
		
		// Define target group ID
		.@group_id = atoi(.@atcmd_parameters$[0]);
		
		// Determine target player name
		for (.@i = 1; .@i < .@atcmd_numparameters; .@i++) {
			.@player_name_tmp$[.@j++] = .@atcmd_parameters$[.@i];
		}
		
		// Define target player name
		.@player_name$ = implode(.@player_name_tmp$, " ");
		
		// Check if target player is online
		if (!getcharid(3, .@player_name$)) {
			message strcharinfo(0), "'"+ .@player_name$ +"' is not online or does not exist.";
			message strcharinfo(0), .@atcmd_command$ +" failed.";
			
		// Adjust target player group
		} else {
			charcommand "#adjgroup "+ .@player_name$ +" "+ .@group_id;
			query_sql "UPDATE `login` SET `group_id` = '"+ .@group_id +"' WHERE `account_id` = '"+ getcharid(3, .@player_name$) +"'";
			message strcharinfo(0), "'"+ .@player_name$ +"' was moved to group "+ .@group_id +".";
		}
		
		end;

}
Link to comment
Share on other sites

4 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  177
  • Reputation:   21
  • Joined:  01/31/12
  • Last Seen:  

Are you using a recent revision of rAthena?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  51
  • Topics Per Day:  0.01
  • Content Count:  95
  • Reputation:   0
  • Joined:  10/24/14
  • Last Seen:  

Are you using a recent revision of rAthena?

 

Bro. I'm using r17709  /ok

Anyone?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  51
  • Topics Per Day:  0.01
  • Content Count:  95
  • Reputation:   0
  • Joined:  10/24/14
  • Last Seen:  

Posted · Hidden by Conflicts, January 30, 2015 - Removed unnecessary posts.
Hidden by Conflicts, January 30, 2015 - Removed unnecessary posts.

Up

Link to comment

  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  177
  • Reputation:   21
  • Joined:  01/31/12
  • Last Seen:  

Posted · Hidden by Conflicts, January 30, 2015 - Removed unnecessary posts.
Hidden by Conflicts, January 30, 2015 - Removed unnecessary posts.

.....

I've told you on your several other threads that bumping without providing additional information is not allowed.

And you even said:

Oh sorry. didn't know that.  /ok

So stop doing it.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

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