Jump to content
  • 0

Please Need Help About PK :3


AHMADSHIDQI

Question


  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.01
  • Content Count:  64
  • Reputation:   1
  • Joined:  02/18/12
  • Last Seen:  

please help me to make a script,it's function is to make every player that killed by other player will lose 1 point,excluding monster or mvp

 

this my script :

-	script	PK System Minus	-1,{
	
OnPCDieEvent:
		if( killedrid != getcharid(0) ){	
			if ( .@map$=="artz_pvp" | .@map$=="prt_pvp"  ) end;
			set .@point_amt, 1;
			set #KAFRAPOINTS, #KAFRAPOINTS - .@point_amt;
			dispbottom "You have lost 1 Point of Honour."; 
			dispbottom "Your Total Points are : "+#KAFRAPOINTS+"";
}
end;
}

im noob :(

Link to comment
Share on other sites

7 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

you didn't tell your server is pk enabled server =/

-    script    PK System Minus    -1,{
OnPCKillEvent:
    if ( !getd( "."+ strcharinfo(3) ) ) end; // only trigger on the maps defined in that array
    attachrid killedrid;
    .@point_amt = 1; // point to minus
    if ( #KAFRAPOINTS - .@point_amt < 0 ) end; // prevent the value go into negative
    #KAFRAPOINTS = #KAFRAPOINTS - .@point_amt ;
    dispbottom "You have lost "+ .@point_amt +" Point of Honour.";
    dispbottom "Your Total Points are : "+ #KAFRAPOINTS;
    end;
OnInit:
    setarray .@map$, "prontera", "morocc", "payon"; // put all the maps here
    .@size = getarraysize( .@map$ );
    while ( .@i < .@size ) {
        setd "."+ .@map$[.@i], 1;
        .@i++;
    }
    end;
}

used some tricks ... :ph34r:

Edited by AnnieRuru
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

-	script	PK System Minus	-1,{

OnPCKillEvent:

if ( !getmapflag( strcharinfo(3), mf_pvp ) ) end; // only trigger in pvp maps

attachrid killedrid;

.@point_amt = 1; // point to minus

if ( #KAFRAPOINTS - .@point_amt < 0 ) end; // prevent the value go into negative

#KAFRAPOINTS = #KAFRAPOINTS - .@point_amt ;

dispbottom "You have lost "+ .@point_amt +" Point of Honour.";

dispbottom "Your Total Points are : "+ #KAFRAPOINTS;

end;

}

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.01
  • Content Count:  64
  • Reputation:   1
  • Joined:  02/18/12
  • Last Seen:  

Thanks annie ^^

 

But, this script trigger in all maps >.<, how can i add excluding maps in this script?

 

like

 

artz_pvp map

n

prt_pvp map

Edited by AHMADSHIDQI
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  58
  • Reputation:   6
  • Joined:  06/16/13
  • Last Seen:  


- script PK System Minus -1,{

OnInit:

setarray .Map$[0], "artz_pvp", "prt_pvp";

set .size, getarraysize(.Map$);

end;

OnPCKillEvent:

if ( !getmapflag( strcharinfo(3), mf_pvp ) ) end; // only trigger in pvp maps

attachrid killedrid;

.@point_amt = 1; // point to minus

if ( #KAFRAPOINTS - .@point_amt < 0 ) end; // prevent the value go into negative

#KAFRAPOINTS = #KAFRAPOINTS - .@point_amt ;

dispbottom "You have lost "+ .@point_amt +" Point of Honour.";

dispbottom "Your Total Points are : "+ #KAFRAPOINTS;

end;

}

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.01
  • Content Count:  64
  • Reputation:   1
  • Joined:  02/18/12
  • Last Seen:  

you didn't tell your server is pk enabled server =/

-    script    PK System Minus    -1,{
OnPCKillEvent:
    if ( !getd( "."+ strcharinfo(3) ) ) end; // only trigger on the maps defined in that array
    attachrid killedrid;
    .@point_amt = 1; // point to minus
    if ( #KAFRAPOINTS - .@point_amt < 0 ) end; // prevent the value go into negative
    #KAFRAPOINTS = #KAFRAPOINTS - .@point_amt ;
    dispbottom "You have lost "+ .@point_amt +" Point of Honour.";
    dispbottom "Your Total Points are : "+ #KAFRAPOINTS;
    end;
OnInit:
    setarray .@map$, "prontera", "morocc", "payon"; // put all the maps here
    .@size = getarraysize( .@map$ );
    while ( .@i < .@size ) {
        setd "."+ .@map$[.@i], 1;
        .@i++;
    }
    end;
}

used some tricks ... :ph34r:

 

wow, thanks annie :3, we always love you :D

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

Note the trick won't work for several maps "pvp_n1-1", "1@tower" with @ or - in the name

 

It was my comment of the day

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

it works

 

prontera,158,185,6    script    kjdfhksj    100,{
    setd ".pvp_n1-1$", "this is a pvp map";
    setd ".1@tower$", "this is an instance map";
    dispbottom getd(".pvp_n1-1$");
    dispbottom getd(".1@tower$");
    end;
}
 

post-8685-0-49883200-1390157595_thumb.jpg

I knew it wont work if you do

set .pvp_n1-1$
but it works when you *setd it

setd ".pvp_n1-1$"
this is a trick to bypass the variable check

yeah rathena script engine sucks ... this is an exploit to rathena script engine

EDIT: -

prontera,158,185,6	script	kjdfhksj	100,{
	dispbottom getd(".pvp_n1-1") +"";
	dispbottom getd(".pvp_n1-1$");
	dispbottom getd(".1@tower") +"";
	dispbottom getd(".1@tower$");
	end;
OnInit:
	setd ".pvp_n1-1", 12345;
	setd ".pvp_n1-1$", "this is a pvp map";
	setd ".1@tower", 67890;
	setd ".1@tower$", "this is an instance map";
	end;
}
also works

post-8685-0-63480500-1390158744_thumb.jpg

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