Jump to content
  • 0

@adjgm ( adjust GM lvl in game )


Question

Posted

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;

}

4 answers to this question

Recommended Posts

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.

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...