Jump to content
  • 0

Please Need Help About PK :3


Question

Posted

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 :(

7 answers to this question

Recommended Posts

Posted (edited)

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
Posted

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

}

Posted (edited)

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
Posted


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

}

Posted

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

Posted

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

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