Jump to content
  • 0

Obtain Points Only if Killed Player has a Variable


Question

Posted

Hello community,

I'm working on a special PvP Script where a Player can obtain points only if the opponent has the same variable but I couldn't find anything accurate so far.

I was wondering if you could give me a hand on this:

OnPCKillEvent:
if ( killedrid != getcharid(3) && EnableGod == 1  )  {
set GodKills, GodKills+1;
}
end;

It seems that it would just recognize my variable (as the Killer) but not for the opponent. If I set my variable 0, nothing would just happen. If I have the variable 1 I would get the points. But if the opponent has the variable 0 it would just give me the points anyway.

Is there any special script to check the other player's variable?

Thank you in advance.

6 answers to this question

Recommended Posts

  • 1
Posted (edited)
	set .@killedvar,getvar(EnableGod,getcharid(0,rid2name(killedrid)));
	if(.@killedvar == 1 && EnableGod == 1){
		PvPkills++;
		dispbottom "You have won points.";
		dispbottom "God Point(s): "+PvPkills+".";
	}

 

Edited by sader1992
  • 0
Posted (edited)

Hello @sader1992,

Well, the thing is that I want the script to give "God Points" only if both of the players have the variable "EnableGod" and its value is 1.

For example:

If my character has variable EnableGod == 1 (and the other player has it too), then if I get to kill the opponent I get 1 PvPkill. In another case, if I kill another opponent but he has EnableGoD == 0, then my kill won't count and I will not get the points.

This is what I have made so far:

OnPCKillEvent:
set .@killedvar,getvar(EnableGod,killedrid);
if ( killedrid != getcharid(3) && .@killedvar == 1 )  {

set PvPkills, PvPkills+1;
if (PvPkills == 1) goto L_PKGetFame;
end;

L_PKGetFame:
dispbottom "You have won points.";
dispbottom "God Point(s): "+PvPkills+".";
end;
}
end;

But still does not work.

Edited by GMHelios

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