Jump to content
  • 0
Sign in to follow this  
karazu

GD_PK_TITLE works in certain map only

Question

Hello, I pmed Goddameit  a suggestion to make the script or edit to make it work in certain map only. but he doenst have time and just told me to put "onpckillevent" in it, well obviously i don't know how to.

So I hope to anyone knows can insert it please?



It will be like the Script will only count the kills in the certain map only.

This is the script.

 

 

////	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 .@i,0; .@i<.SP_RANK; set .@i,.@i+1 )	{		if( getcharid(0) == .SP_RN_CID[.@i] )		{			set .@N$,GETTILE(.@i+1);			if( .@N$ != "" )			{				atcommand "@fakename "+.@N$+""+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` = "+@GDCID+"",@GDTID;	if( !@GDTID )		query_sql "INSERT `GD_PK_TITLE` VALUES("+@GDCID+",1)";	else		query_sql "UPDATE `GD_PK_TITLE` SET `var` = `var`+1 WHERE `char_id` = "+@GDCID+"";	set @GDTID,0;	set @GDCID,0;	end;OnInit:	bindatcmd "delpktitle","GD_PK_TITLE::OnGMFActive1",99,99,0;	bindatcmd "refhpktile","GD_PK_TITLE::OnGMFActive3",99,99,0;	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 .@i,0; .@i<.SP_RANK; set .@i,.@i+1 )		{			query_sql "SELECT `account_id` FROM `char` WHERE `char_id` = "+.SP_RN_CID[.@i]+"",.@SP_RN_AID;			if( attachrid(.@SP_RN_AID) )			{				if( .TMP_SP_RN_CID[.@i] == .SP_RN_CID[.@i] && @PK_TITL_BOOL )				{					detachrid;					continue;				}				if( getarg(0,0) == 1 )				{					set .@N$,GETTILE(.@i+1);					if( .@N$ != "" )					{						atcommand "@fakename "+.@N$+""+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 .@SP_RANK,getvariableofnpc(.SP_RANK,"GD_PK_TITLE");	for(set .@i,0; .@i<.@SP_RANK; set .@i,.@i+1 )	{		set .@SP_RN_CID,getvariableofnpc(.SP_RN_CID[.@i],"GD_PK_TITLE");		set .@SP_RN_VAR,getvariableofnpc(.SP_RN_VAR[.@i],"GD_PK_TITLE");		if( !.@SP_RN_CID || !.@SP_RN_VAR )			break;		query_sql "SELECT `name` FROM `char` WHERE `char_id` = "+.@SP_RN_CID+"",.@SP_RN_NAME$;		mes "[#"+(.@i+1)+"] "+.@SP_RN_NAME$+" "+.@SP_RN_VAR+"p";	}	close;} 

 


 

Share this post


Link to post
Share on other sites

6 answers to this question

Recommended Posts

  • 0

If you only want this to work in only 1 map, try this:

 

Change

OnPCKillEvent:    if( killedrid == getcharid(3) || !isloggedin(killedrid) )

 

To

OnPCKillEvent:    if( killedrid == getcharid(3) || !isloggedin(killedrid) || strcharinfo(3) != "MAPNAME" )

 

Remember to change MAPNAME to the map name you want it to work.

Share this post


Link to post
Share on other sites
  • 0

If you only want this to work in only 1 map, try this:

 

Change

OnPCKillEvent:    if( killedrid == getcharid(3) || !isloggedin(killedrid) )

 

To

OnPCKillEvent:    if( killedrid == getcharid(3) || !isloggedin(killedrid) || strcharinfo(3) != "MAPNAME" )

 

Remember to change MAPNAME to the map name you want it to work.

Is it possible to add more? I want at least 2 map

Share this post


Link to post
Share on other sites
  • 0

For two maps:

OnPCKillEvent:    if( killedrid == getcharid(3) || !isloggedin(killedrid) || (strcharinfo(3) != "MAPNAME" && strcharinfo(3) != "MAPNAME2") )

 

For three maps:

OnPCKillEvent:    if( killedrid == getcharid(3) || !isloggedin(killedrid) || (strcharinfo(3) != "MAPNAME" && strcharinfo(3) != "MAPNAME2" && strcharinfo(3) != "MAPNAME3") )

And so on...

Share this post


Link to post
Share on other sites
  • 0

For two maps:

OnPCKillEvent:    if( killedrid == getcharid(3) || !isloggedin(killedrid) || (strcharinfo(3) != "MAPNAME" && strcharinfo(3) != "MAPNAME2") )

 

For three maps:

OnPCKillEvent:    if( killedrid == getcharid(3) || !isloggedin(killedrid) || (strcharinfo(3) != "MAPNAME" && strcharinfo(3) != "MAPNAME2" && strcharinfo(3) != "MAPNAME3") )

And so on...

Thank you very much! gonna test it later

Share this post


Link to post
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
Answer this question...

×   Pasted as rich text.   Restore formatting

  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.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

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