Jump to content
  • 0

Looking for clarification on "killedrid"


Question

9 answers to this question

Recommended Posts

  • 0
Posted

what do you mean by job id ?

you want the job id of the player who is killed ?

you can do readparam()
 

OnPCKillEvent:
	debugmes ""  + readparam(Class,convertpcinfo(killedrid,CPC_CHAR));
end;

readparam(Class,convertpcinfo(killedrid,CPC_CHAR)) will return the class of the killed if it's a player ofc , hint OnPCKillEvent

  • Upvote 1
  • Love 1
  • 0
Posted
16 minutes ago, sader1992 said:

what do you mean by job id ?

you want the job id of the player who is killed ?

you can do readparam()
 


OnPCKillEvent:
	debugmes ""  + readparam(Class,convertpcinfo(killedrid,CPC_CHAR));
end;

readparam(Class,convertpcinfo(killedrid,CPC_CHAR)) will return the class of the killed if it's a player ofc , hint OnPCKillEvent

Great thank you btw it possible certain class job?

  • 0
Posted (edited)
1 hour ago, sader1992 said:

I didn't understand

The player's class is his job id


Sorry if you did not understand what I said, 
I want to make a pvp event challenge and the challenge will kill specific jobs 
like kill 5 assassin cross or kill 1 sniper / high wizard etc. I want to know how he can kill count every job
Edited by Zack-
  • 0
Posted

You have to add up something like this

OnPCKillEvent:
		.@self = getcharid(3);
		if (killedrid == .@self) end;
		attachrid killedrid; 
		.@class = Class;
		attachrid .@self;
		.@index = inarray(class_arr, .@class);
		if (.@index == -1) {
			.@size = getarraysize(class_arr);
			class_arr[.@size] = .@class;
			count_arr[.@size] = 1;
		} else
			cleararray count_arr[.@index], count_arr[.@index] + 1, 1;
		end;

and then you can create npc to fetch all the details like below

.@size = getarraysize(class_arr);
	if (!.@size)
		mes "No data";
	else {
		mes "Your kills per class";
		for (.@i = 0; .@i < .@size; .@i++)
			mes "> Job:" + jobname(class_arr[.@i]) + " | Kill Count:" + count_arr[.@i];
	}
	close;

 

  • Love 1
  • 0
Posted
11 hours ago, Patskie said:

You have to add up something like this


OnPCKillEvent:
		.@self = getcharid(3);
		if (killedrid == .@self) end;
		attachrid killedrid; 
		.@class = Class;
		attachrid .@self;
		.@index = inarray(class_arr, .@class);
		if (.@index == -1) {
			.@size = getarraysize(class_arr);
			class_arr[.@size] = .@class;
			count_arr[.@size] = 1;
		} else
			cleararray count_arr[.@index], count_arr[.@index] + 1, 1;
		end;

and then you can create npc to fetch all the details like below


.@size = getarraysize(class_arr);
	if (!.@size)
		mes "No data";
	else {
		mes "Your kills per class";
		for (.@i = 0; .@i < .@size; .@i++)
			mes "> Job:" + jobname(class_arr[.@i]) + " | Kill Count:" + count_arr[.@i];
	}
	close;

 

 

I see. im gonna try thank you

  • 0
Posted
On 8/31/2020 at 6:55 PM, Patskie said:

You have to add up something like this


OnPCKillEvent:
		.@self = getcharid(3);
		if (killedrid == .@self) end;
		attachrid killedrid; 
		.@class = Class;
		attachrid .@self;
		.@index = inarray(class_arr, .@class);
		if (.@index == -1) {
			.@size = getarraysize(class_arr);
			class_arr[.@size] = .@class;
			count_arr[.@size] = 1;
		} else
			cleararray count_arr[.@index], count_arr[.@index] + 1, 1;
		end;

and then you can create npc to fetch all the details like below


.@size = getarraysize(class_arr);
	if (!.@size)
		mes "No data";
	else {
		mes "Your kills per class";
		for (.@i = 0; .@i < .@size; .@i++)
			mes "> Job:" + jobname(class_arr[.@i]) + " | Kill Count:" + count_arr[.@i];
	}
	close;

 

Its working, btw can you give me an idea how can i make it similar here

OnNPCKillEvent:
	if( killedrid == 1002 ){
	set #PoringKill,#PoringKill + 1;
	end;

 

  • 0
Posted
1 hour ago, Patskie said:

OnNPCKillEvent is for monster. 

Yah thanks for correction, everything is working fine and im using it now, i try to edit your code

4 hours ago, Zack- said:

OnNPCKillEvent: if( killedrid == 1002 ){ set #PoringKill,#PoringKill + 1; end;

i want to make similar this i tried to modified your code and change the Class to JobID 4010 and class_arr[.@size] = .@class; to class_arr[.@size] = .@class, set #HWPoints,#HWPoints +1; but not working

-	script	test123	-1,{
OnPCKillEvent:
		.@self = getcharid(3);
		if (killedrid == .@self) end;
		attachrid killedrid; 
		.@class = 4010;
		attachrid .@self;
		.@index = inarray(class_arr, .@class);
		if (.@index == -1) {
			.@size = getarraysize(class_arr);
			class_arr[.@size] = .@class, set #HWPoints,#HWPoints + 1;
			count_arr[.@size] = 1;
			
		} else
			cleararray count_arr[.@index], count_arr[.@index] + 1, 1;
		end;
	}

 

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