Jump to content
  • 0

OnPCKillEvent & OnPCDieEvent:


Nerks

Question


  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.01
  • Content Count:  135
  • Reputation:   4
  • Joined:  07/29/17
  • Last Seen:  

Guys question how can i transefer the "killerrid" & "killedrid" to a variable?

 

//*OnPCDieEvent:

This special label triggers when a player dies. The variable 'killerrid'
is set to the ID of the killer.

OnPCKillEvent:

This special label triggers when a player kills another player. The
variable 'killedrid' is set to the ID of the player killed.*//

 

Thanks :)

Link to comment
Share on other sites

9 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  15
  • Topics Per Day:  0.00
  • Content Count:  52
  • Reputation:   35
  • Joined:  06/28/13
  • Last Seen:  

-	script	simple	-1,{
OnPCKillEvent:
	.@killer_rid = killerrid;
	.@killed_rid = killedrid;
    // do your stuff
end;
}

both of these variables are available in both events

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.01
  • Content Count:  135
  • Reputation:   4
  • Joined:  07/29/17
  • Last Seen:  

7 minutes ago, NotKappa said:

-	script	simple	-1,{
OnPCKillEvent:
	.@killer_rid = killerrid;
	.@killed_rid = killedrid;
    // do your stuff
end;
}

both of these variables are available in both events

One more question.

 

 //*OnPCDieEvent:

This special label triggers when a player dies. The variable 'killerrid'
is set to the ID of the killer.

OnPCKillEvent:

This special label triggers when a player kills another player. The
variable 'killedrid' is set to the ID of the player killed.*// 

Base on my understanding. The label OnPCDieEvent can only use the variable KILLERRID not the KILLEDRID vice versa.

Am i correct? or even your not using OnPCKillEvent you can use the variable KILLEDRID?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  15
  • Topics Per Day:  0.00
  • Content Count:  52
  • Reputation:   35
  • Joined:  06/28/13
  • Last Seen:  

8 minutes ago, Nerks said:

One more question.

 


 //*OnPCDieEvent:

This special label triggers when a player dies. The variable 'killerrid'
is set to the ID of the killer.

OnPCKillEvent:

This special label triggers when a player kills another player. The
variable 'killedrid' is set to the ID of the player killed.*// 

Base on my understanding. The label OnPCDieEvent can only use the variable KILLERRID not the KILLEDRID vice versa.

Am i correct? or even your not using OnPCKillEvent you can use the variable KILLEDRID?

well as I said both of the variables are available in both events

killerrid holds the killer ID

and killedrid holds the killed target rid

both killerrid and killedrid are in the events OnPCDieEvent and OnPCKillEvent

Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2346
  • Joined:  10/28/11
  • Last Seen:  

OnPCDieEvent:
	.@new_variable_1 = killerrid;
	dispbottom ".@new_variable_1 = " + .@new_variable_1;
	end;

OnPCKillEvent:
	.@new_variable_2 = killedrid;
	dispbottom ".@new_variable_2 = " + .@new_variable_2;
	end;

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.01
  • Content Count:  135
  • Reputation:   4
  • Joined:  07/29/17
  • Last Seen:  

53 minutes ago, NotKappa said:

well as I said both of the variables are available in both events

killerrid holds the killer ID

and killedrid holds the killed target rid

both killerrid and killedrid are in the events OnPCDieEvent and OnPCKillEvent

For clarification.

So i can use both variable even i use OnPCDieEvent only and vice versa?

Right?

 

19 minutes ago, Emistry said:

OnPCDieEvent:
	.@new_variable_1 = killerrid;
	dispbottom ".@new_variable_1 = " + .@new_variable_1;
	end;

OnPCKillEvent:
	.@new_variable_2 = killedrid;
	dispbottom ".@new_variable_2 = " + .@new_variable_2;
	end;

 

can i use this?

OnPCDieEvent:
	.@new_variable_1 = killerrid;
	.@new_variable_2 = killedrid;
	dispbottom ".@new_variable_1 = " + .@new_variable_1;
	dispbottom ".@new_variable_2 = " + .@new_variable_2;
	end;

OnPCKillEvent:
	.@new_variable_1 = killerrid;
	.@new_variable_2 = killedrid;
	dispbottom ".@new_variable_1 = " + .@new_variable_1;
	dispbottom ".@new_variable_2 = " + .@new_variable_2;
	end;
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  626
  • Reputation:   188
  • Joined:  11/19/11
  • Last Seen:  

Not directly.

OnPCKillEvent attaches the player which killed someone, while setting the variable  killedrid to the player who died, in case you want to use the rid.

 

OnPCDieEvent attaches the player which died, while setting the variable killerrid to the killer(can be a monster too)

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.01
  • Content Count:  135
  • Reputation:   4
  • Joined:  07/29/17
  • Last Seen:  

9 hours ago, llchrisll said:

Not directly.

OnPCKillEvent attaches the player which killed someone, while setting the variable  killedrid to the player who died, in case you want to use the rid.

 

OnPCDieEvent attaches the player which died, while setting the variable killerrid to the killer(can be a monster too)

Base on your answer so i can't use the killerrid in OnPCKillEvent label?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  626
  • Reputation:   188
  • Joined:  11/19/11
  • Last Seen:  

Nope because the player who killed someone is already attached to the script.

Which means you can call other commands like strcharinfo() and so on

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.01
  • Content Count:  135
  • Reputation:   4
  • Joined:  07/29/17
  • Last Seen:  

1 hour ago, llchrisll said:

Nope because the player who killed someone is already attached to the script.

Which means you can call other commands like strcharinfo() and so on

@llchrisll @Emistry @NotKappa

Thank you for your answers :)

Till next time :)

Link to comment
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...