Jump to content
Sign in to follow this  
Litro

Couple Day Counter

Recommended Posts

well its my first time scripting, actually this script is taken from here and there, im total noob please be gentle with me and tell me or guide me where im wrong or how i can maximize my scripting capability

 

anyway here my script please check this out

 

-	script	asdasdawe	-1,{OnPCLoginEvent:	if (getpartnerid()){		query_sql "SELECT `name` FROM `char` WHERE `char_id`="+getpartnerid()+" ",.@couplename$;		set .@couple,getcharid(3,.@couplename$);		set .@invokeid,getcharid(3);		detachrid;		if(.@couple && attachrid(.@couple)) {			message strcharinfo(0),"Couple Has Logged In";			attachnpctimer ""+strcharinfo(0)+"";			initnpctimer;			detachrid;			attachrid(.@invokeid);			attachnpctimer ""+strcharinfo(0)+"";			initnpctimer;			end;		} else {			set .@couple,0;			end;		}	}	end;OnPCLogoutEvent:	if (ispartneron()){		query_sql "SELECT `name` FROM `char` WHERE `char_id`="+getpartnerid()+" ",.@couplename$;		set .@couple,getcharid(3,.@couplename$);		attachrid(.@couple);		message strcharinfo(0),"Couple Has Logged Out";		stopnpctimer;		end;	} else {		end;	}OnTimer60000:OnTimer120000:OnTimer180000:OnTimer240000:	if ((checkvending() >= 1) || (!ispartneron())) {		stopnpctimer;		end;	}OnTimer300000:	query_sql( "INSERT INTO `Couple_Day` SET `char_id`='"+getcharid(0)+"',`char_name`='"+strcharinfo(0)+"',`day_count`='1' ON DUPLICATE KEY UPDATE `day_count`=`day_count`+1" );	specialeffect2 682;	stopnpctimer;	initnpctimer getcharid(3);	end;	}new_1-1,60,115,0	script	Couple Board	100,{	query_sql "SELECT `name` FROM `char` WHERE `char_id`="+getpartnerid()+" ",.@couple_name$;	query_sql( "select `char_name`,`day_count` FROM `Couple_Day` ORDER BY `day_count` DESC LIMIT 5",.@char_name$,.@day_count );	if( getarraysize( .@char_name$ ) ){		for( set .@i,0; .@i < getarraysize( .@char_name$ ); set .@i,.@i + 1 )			mes "[ "+( .@i + 1 )+". ] "+.@char_name$[.@i]+" - "+.@couple_name$+" : "+.@day_count[.@i]+" Day";	}else{		mes "No Record Found.";	}close;}

To use this script please do query in your mysql

CREATE TABLE IF NOT EXISTS `Couple_Day` (	`char_id` int(11) unsigned NOT NULL default '0',	`char_name` varchar(30) NOT NULL DEFAULT '',	`day_count` int(11) unsigned NOT NULL default '0',	PRIMARY KEY  (`char_id`)) ENGINE=MyISAM;

screenie : post-1503-0-20024800-1395832601_thumb.jpg

Share this post


Link to post
Share on other sites

Hello :)

 

What exactly is it suppose to do?

It supposed to show if your couple logged in / out. You have to be married with somebody to see it.

And if I understood it right, it supposed to show how much days you're together

Edited by Oxxy

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

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