Jump to content
  • 0
Bolby91

Top 5 PvP Player Statues need help

Question

Posted (edited)

Hi guys can you help me what's wrong with this code??

///statue
-	script	CharacterStatues	-1,{
OnInit:
	// -------- C O N F I G U R A T I O N ---------
	// If you put 5 Entries, it will spawn the top 5 in order
setarray .info$[0], // <map name>,<map x>,<map y>; {
		"prontera,147,190", // top 1 statue coordinates
		"prontera,151,190", // top 2 statue coordinates
		"prontera,155,190",
		"prontera,159,190",
		"prontera,163,190";
	// ---------------------------------------------
OnSpawn:
	.size = getarraysize(.info$);
	if($terces_PVP_names$[0] == "") {
		debugmes "PvP Ladder not found! Stopping script!";
		debugmes strnpcinfo(0);
		end;
	}
	.@terces_size = getarraysize($terces_PVP_names$);
	if(.@terces_size < .size) .size = .@terces_size;
	.terces_PVP_names$ = "";
	for( .@i = 0; .@i < .size; .@i++ ) {	
		.terces_PVP_names$ += $terces_PVP_names$[.@i]+":";
		explode(.@tmp$,.info$[.@i],",");
		.@map$ = .@tmp$[0];
		.@x = atoi(.@tmp$[1]);
		.@y = atoi(.@tmp$[2]);
		.@nb = query_sql( " SELECT `char_id`, `name`, `class`, `option`, `hair`, `hair_color`, `clothes_color`, `weapon`, `shield`, `head_top`, `head_mid`, `head_bottom`, `sex` FROM `char` WHERE `name` = '"+$terces_PVP_names$[.@i]+"'", .@char_id, .@name$, .@class, .@option, .@hair, .@hair_color, .@clothes_color, .@weapon, .@shield, .@head_top, .@head_mid, .@head_bottom, .@sex$ );
		if(!.@nb) {
			debugmes "Character Name "+.@name$+" was not found! Statue was skipped and not deployed.";
			continue;
		}
		monster .@map$ ,.@x,.@y,"[Top "+(.@i+1)+"] "+.@name$,1627,1,strnpcinfo(0)+"::OnStatue";
		.mobGID = [email protected][0];
		setunitdata .mobGID, UMOB_CLASS, .@class;
		if(.@option) setunitdata .mobGID, UMOB_SCOPTION, .@option;
		if(.@hair) setunitdata .mobGID, UMOB_HAIRSTYLE, .@hair;
		if(.@hair_color) setunitdata .mobGID, UMOB_HAIRCOLOR, .@hair_color;
		if(.@clothes_color) setunitdata .mobGID, UMOB_CLOTHCOLOR, .@clothes_color;
		if(.@weapon) setunitdata .mobGID, UMOB_WEAPON, .@weapon;
		if(.@shield) setunitdata .mobGID, UMOB_SHIELD, .@shield;
		if(.@head_top) setunitdata .mobGID, UMOB_HEADTOP, .@head_top;
		if(.@head_mid) setunitdata .mobGID, UMOB_HEADMIDDLE, .@head_mid;
		if(.@head_bottom) setunitdata .mobGID, UMOB_HEADBOTTOM, .@head_bottom;
		setunitdata .mobGID, UMOB_SEX, ((.@sex$ == "M")?1:0);
		setunitdata .mobGID, UMOB_SIZE, 1;
		setunitdata .mobGID, UMOB_MODE, 0;
		setunitdata .mobGID, UMOB_LOOKDIR, 4;
		setunitdata .mobGID, UMOB_DMGIMMUNE, 1;
	}
	initnpctimer;
	end;

OnTimer60000: // Every 1 min checks if statues are still there then sort them out based from PvP Ladder
	stopnpctimer;
	for( .@i = 0; .@i < .size; .@i++ ) {
		explode(.@tmp$,.info$[.@i],",");
		if(!compare(.@tmap$,.@tmp$[0])) {
			.@count += mobcount(.@tmp$[0],strnpcinfo(0)+"::OnStatue");
			.@tmap$ += .@tmp$[0]+" ";
		}
		explode(.@tmpname$,.terces_PVP_names$,":");
		if( $terces_PVP_names$[.@i] != .@tmpname$[.@i] || (.@i == .size-1 && .@count < .size)) {
			for( .@j = 0; .@j < .size; .@j++ ) {
				explode(.@tmp$,.info$[.@j],",");
				killmonster .@tmp$[0],strnpcinfo(0)+"::OnStatue";
				cleanarea .@tmp$[0],atoi(.@tmp$[1])-1,atoi(.@tmp$[2])-1,atoi(.@tmp$[1])+1,atoi(.@tmp$[2])+1;
			}
			donpcevent strnpcinfo(0)+"::OnSpawn";
			end;
		}
	}
	initnpctimer;
	end;
}

 

Edited by Haruka Mayumi
Fixed the code removing the error

Share this post


Link to post
Share on other sites

9 answers to this question

Recommended Posts

  • 1
Posted (edited)

The topic also contains uninformative topic title. as well as it's content..
We don't see any problem. this statue top 5 is using @Secrets pvp script. you probably dont use that.

Update 05/28/2020 :  This is the pvp script.

 

Edited by Haruka Mayumi
  • Upvote 2

Share this post


Link to post
Share on other sites
  • 1

You need to load the pvp script first before the Statues.. you must also make sure that there's atleast 1 player on the ranking before you load the statues script ( because that's how the script is made which is really not good )

 

		"prontera,163,190";
} <<<< Remove this (causing error)
	// ---------------------------------------------
OnSpawn:
  • Upvote 1

Share this post


Link to post
Share on other sites
  • 0

i think you missed pvpladder script 

Share this post


Link to post
Share on other sites
  • 0
On 5/25/2020 at 5:44 AM, Haruka Mayumi said:

The topic also contains uninformative topic title. as well as it's content..
We don't see any problem. this statue top 5 is using @Secrets pvp script. you probably dont use that.

Update 05/28/2020 :  This is the pvp script.

 

not working

Share this post


Link to post
Share on other sites
  • 0
7 hours ago, Freecz said:

not working

simple 2 words like "not working" will not solve your problem.

Share this post


Link to post
Share on other sites
  • 0
2 hours ago, Haruka Mayumi said:

simple 2 words like "not working" will not solve your problem.

well simply i tried what you said right? i installed the statue script and the pvp script you posted. Do i have to say all of that??

Share this post


Link to post
Share on other sites
  • 0
6 minutes ago, Freecz said:

well simply i tried what you said right? i installed the statue script and the pvp script you posted. Do i have to say all of that??

Adding information like Error on console is an additional information.. this is tested and is working fine on my side.
image.png.d5298440e9154a5935e20c7582b16554.png
 

Share this post


Link to post
Share on other sites
  • 0

hmm? do you have to wait for a long time for it to load?

do i have to edit something after i install the script??

image.png.c527e168cda0b8699efd9752ccb830bb.png

 

image.thumb.png.a6894d5c4bdd79e91bf543c95d2f6b1b.png

On 6/3/2020 at 10:42 AM, Haruka Mayumi said:

You need to load the pvp script first before the Statues.. you must also make sure that there's atleast 1 player on the ranking before you load the statues script ( because that's how the script is made which is really not good )

		"prontera,163,190";
} <<<< Remove this (causing error)
	// ---------------------------------------------
OnSpawn:

thanks i got it working now thanks to you

Share this post


Link to post
Share on other sites
  • 0
On 5/25/2020 at 6:44 PM, Haruka Mayumi said:

The topic also contains uninformative topic title. as well as it's content..
We don't see any problem. this statue top 5 is using @Secrets pvp script. you probably dont use that.

Update 05/28/2020 :  This is the pvp script.

 

is this possible for other pvp script made by other scripter?

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