Jump to content
  • 0

Obtain Points Only if Killed Player has a Variable


Strand

Question


  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  102
  • Reputation:   2
  • Joined:  07/01/13
  • Last Seen:  

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.

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 1

  • Group:  Content Moderator
  • Topic Count:  55
  • Topics Per Day:  0.02
  • Content Count:  1676
  • Reputation:   703
  • Joined:  12/21/14
  • Last Seen:  

	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
Link to comment
Share on other sites

  • 0

  • Group:  Content Moderator
  • Topic Count:  55
  • Topics Per Day:  0.02
  • Content Count:  1676
  • Reputation:   703
  • Joined:  12/21/14
  • Last Seen:  

*getvar <variable>,<char_id>;
Edited by sader1992
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  102
  • Reputation:   2
  • Joined:  07/01/13
  • Last Seen:  

Hello sader1992.

How do I exactly insert it on the script to make it work?

I just tried but did not work properly.

Thank you.

Link to comment
Share on other sites

  • 0

  • Group:  Content Moderator
  • Topic Count:  55
  • Topics Per Day:  0.02
  • Content Count:  1676
  • Reputation:   703
  • Joined:  12/21/14
  • Last Seen:  

well i didn't understand your question to apply it to the script but it's what you are looking for

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  102
  • Reputation:   2
  • Joined:  07/01/13
  • Last Seen:  

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
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  102
  • Reputation:   2
  • Joined:  07/01/13
  • Last Seen:  

Thank you Sader.

It totally worked.

 

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