Jump to content
  • 0

Commands for lvl 20 up players


Question

Posted

good day masters is this possible???

 

when the player is lvl 1 only he/she cant use commands unless he reach a base lvl of 20??

 

commands can be use starting from lvl20 up to max lvl thank you

2 answers to this question

Recommended Posts

  • 0
Posted
-	script	commands_start	-1,{
	OnPCBaseLvUpEvent:
		if ( BaseLevel >= 20 && getgroupid(0) == 0 ) {
			query_sql("UPDATE `login` SET `group_id` = 1 WHERE `account_id` ="+getcharid(3)+"");
			announce strcharinfo(0)+" has unlocked player commands",0;
			dispbottom "congratulations! now you need to relog to use commands";
		}
		end;
}

add the groupid checking before alter the groupid, this help to prevent the script affecting any GM in case they level up their characters, or cases where player assigned to different group id that isn't equal to 0.

  • Upvote 2
  • 1
Posted (edited)
-	script	commands_start	-1,{
OnPCBaseLvUpEvent:
		if ( BaseLevel >= 20  ) {
          query_sql("UPDATE `login` SET `group_id` = 1 WHERE `account_id` ="+getcharid(3)+"");
	announce strcharinfo(0)+" has unlocked player commands",0;
	dispbottom "congratulations! now you need to relog to use commands";
	end;
        }
}

give commands to group one instead of group 0, so when they reach level 20 script change groupid to 1 ( i didn't test the script though )

Edited by Cyro
  • Upvote 1

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