Jump to content

Question

Posted

There is some script that can do the following: at a certain time it selects 2 random players from the server and puts them to fight each other, who wins receives a reward.

1 answer to this question

Recommended Posts

  • 0
Posted

-	script	Sample	-1,{
	
	OnInit:
		.map$ = "prontera";
		end;
	
	OnMinute00: // every hour
		deletearray .aid;
		mapwarp .map$, "prontera", 155, 181;
		query_sql("SELECT `account_id`,`char_id`,`name` FROM `char` WHERE `online` = 1 ORDER BY RAND() LIMIT 2", .aid, .@cid, .@name$);
		announce "<SYSTEM> Both '"+.@name$[0]+"' and '"+.@name$[1]+"' are selected to join the event. Good luck in killing each other for rewards", bc_all;
		warp .map$, 0, 0, .@cid[0];
		warp .map$, 0, 0, .@cid[1];
		end;
		
	OnPCKillEvent:
		if (strcharinfo(3)) {
			.@aid = getcharid(3);
			if (killedrid == .@aid)
				.@aid = .aid[(.@aid == .aid[0])];
			
			if (attachrid(.@aid)) {
				// rewards
				getitem 512, 1;
				getitem 512, 2;
				getitem 512, 3;
				announce "<SYSTEM> '"+strcharinfo(0)+"' has won.", bc_all;
			}
		}
		deletearray .aid;
		mapwarp .map$, "prontera", 155, 181;
		end;
}

try this.

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