Jump to content

Recommended Posts

This system will give title (by @fakename) to who is on the list automatically.
 
Preview:
https://www.youtube.com/watch?v=kTXp3ZiT7ZY
 
-----------------------------------------------------------------
 
Download:
Script
GD_PK_TITLE_2.txt (info)
GD_PK_TITLE.txt
SQL
gd_pk_title.sql
 
-----------------------------------------------------------------
 
 
Command:
@delpktitle for clean the datebase
@refhpktile for refresh the datebase
 
-----------------------------------------------------------------
 
Setting:
Define this rank is top 2 of killer

set .SP_RANK,2;

Define system will give "[MVP]" to top 1 player

	function	GETTILE	{
		switch(getarg(0,0))
		{
			case 1: return "[MVP]";
			default: return "";
		}
	}
Edited by goddameit
  • Upvote 2
Link to comment
Share on other sites

hello, i don't have time to test it but, do you really need to manually input some command to enable the title?

is there a way to make it automatic.

Link to comment
Share on other sites

hello, i don't have time to test it but, do you really need to manually input some command to enable the title?

is there a way to make it automatic.

 

you don't, those command is for GM for clean or refresh database

 

system will auto-refrsh every 1min and this also will give title to top player.

Link to comment
Share on other sites

hello what if he ha a very long name does it affect?

 

oh and the bindatcmd syntax is it really written that way? im having an error , i followed the syntax in the wiki and works well again.

i also notice that when i change character the MVP title goes to him(same account). is it really like that?

 

i suggest to add death counts

Edited by Mr BrycE
Link to comment
Share on other sites

Here's a fixed one..

//
//	Author		Goddameit
//	Version		2013/12/03
//	Web__		http://goo.gl/igS14r
//
-	script	gd_pk_title	-1,{
	function	SETTILE	;
	function	GETTILE	{
		switch(getarg(0,0))
		{
			case 1: return "[MVP]";
			default: return "";
		}
	}
OnPCLoginEvent:
	for(set [email protected],0; [email protected]<.SP_RANK; set [email protected],[email protected]+1 )
	{
		if( getcharid(0) == .SP_RN_CID[[email protected]] )
		{
			set [email protected]$,GETTILE([email protected]+1);
			if( [email protected]$ != "" )
			{
				atcommand "@fakename "[email protected]$+""+strcharinfo(0);
				set @PK_TITL_BOOL,1;
			}
			break;
		}
	}
	end;
OnPCKillEvent:
	if( killedrid == getcharid(3) || !isloggedin(killedrid) )
		end;
	set @GDCID,getcharid(0);
	query_sql "SELECT `char_id` FROM `gd_pk_title` WHERE `char_id` = "[email protected]+"",@GDTID;
	if( [email protected] )
		query_sql "INSERT `gd_pk_title` VALUES("[email protected]+",1)";
	else
		query_sql "UPDATE `gd_pk_title` SET `var` = `var`+1 WHERE `char_id` = "[email protected]+"";
	set @GDTID,0;
	set @GDCID,0;
	end;
OnInit:
	bindatcmd "delpktitle","gd_pk_title::OnGMFActive1",99,99;
	bindatcmd "refhpktile","gd_pk_title::OnGMFActive3",99,99;
	set .SP_RANK,2;
OnGMFActive3:
	if( playerattached() )
	{
		dispbottom "All date was refresh.";
		detachrid;
	}
OnTimer60000:
	stopnpctimer;
	deletearray .TMP_SP_RN_CID[0],128;
	query_sql "SELECT `char_id` FROM `gd_pk_title` ORDER BY `var` DESC LIMIT "+.SP_RANK,.TMP_SP_RN_CID;
	SETTILE(0);
	deletearray .SP_RN_CID[0],128;
	deletearray .SP_RN_VAR[0],128;
	query_sql "SELECT `char_id`,`var` FROM `gd_pk_title` ORDER BY `var` DESC LIMIT "+.SP_RANK,.SP_RN_CID,.SP_RN_VAR;
	SETTILE(1);
	deletearray .TMP_SP_RN_CID[0],128;
	initnpctimer;
	end;
OnGMFActive1:
	query_sql "TRUNCATE TABLE  `gd_pk_title`";
	dispbottom "All date was cleaned.";
	end;
	function	SETTILE	{
		for(set [email protected],0; [email protected]<.SP_RANK; set [email protected],[email protected]+1 )
		{
			query_sql "SELECT `account_id` FROM `char` WHERE `char_id` = "+.SP_RN_CID[[email protected]]+"",[email protected]_RN_AID;
			if( attachrid([email protected]_RN_AID) )
			{
				if( .TMP_SP_RN_CID[[email protected]] == .SP_RN_CID[[email protected]] && @PK_TITL_BOOL )
				{
					detachrid;
					continue;
				}
				if( getarg(0,0) == 1 )
				{
					set [email protected]$,GETTILE([email protected]+1);
					if( [email protected]$ != "" )
					{
						atcommand "@fakename "[email protected]$+""+strcharinfo(0);
						set @PK_TITL_BOOL,1;
					}
				}else
					if( @PK_TITL_BOOL )
					{
						atcommand "@fakename";
						set @PK_TITL_BOOL,0;
					}
				detachrid;
			}
		}
		return;
	}
}
prontera,150,180,4	script	Rank	100,{
	mes "[Rank]";
	set [email protected]_RANK,getvariableofnpc(.SP_RANK,"gd_pk_title");
	for(set [email protected],0; [email protected]<[email protected]_RANK; set [email protected],[email protected]+1 )
	{
		set [email protected]_RN_CID,getvariableofnpc(.SP_RN_CID[[email protected]],"gd_pk_title");
		set [email protected]_RN_VAR,getvariableofnpc(.SP_RN_VAR[[email protected]],"gd_pk_title");
		if( [email protected]_RN_CID || [email protected]_RN_VAR )
			break;
		query_sql "SELECT `name` FROM `char` WHERE `char_id` = "[email protected]_RN_CID+"",[email protected]_RN_NAME$;
		mes "[#"+([email protected]+1)+"] "[email protected]_RN_NAME$+" "[email protected]_RN_VAR+"p";
	}
	close;
}
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...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.