Jump to content
  • 0

how to modify pvp ladder? need help


Question

Posted (edited)

the script is working fine.. i want to request to modify this script to put some anti exploit code..

*paladin kill her/him self using grand cross

*anti killing novice this ladder work in 2nd class only and blv99 and joblv70 if not kill and die not counting.

*work on this map only guild_vs3,etc,etc,etc;

adding gmgrouplvl 3 above will not count all kill and deaths.

is this code right? and add this after OnPCKillEvent:?

if ( killerrid == getcharid(3) ) end; // kill himself(like grandcross) doesn't add kills count.

if ( strcharinfo(3) != "guild_vs3","pvp_y_1-2","pvp_y_1-2" || (Class > 4000 && Class < 4023) || BaseLevel < 99) || JobLevel < 70) end; // Level 99/70 doesn't add kills and deaths count.

/*
create table pvpladder (
cid int(11) primary key,
name varchar(23),
kills int(11),
deaths int(11),
class int(11),
key (kills)
) engine = myisam;
*/
prontera,164,170,2 script PvP Ladder 786,{
mes "^228B22[ Top 10 PvP Ladder ]^000000";
.@nb = query_sql( "select name, kills, deaths, class from pvpladder order by kills desc limit 10", .@name$, .@kills, .@deaths, .@class );
if ( !.@nb ) {
 mes "ladder is empty";
 close;
}
for ( .@i = 0; .@i < .@nb; .@i++ )
 mes "^0000FF"+ (.@i+1) +": ^228B22"+ .@name$[.@i] +" ^606060"+ jobname(.@class[.@i]) +" ^0000FF"+ .@kills[.@i] +" / ^FF0000"+ .@deaths[.@i] +"^000000";
close;
OnPCKillEvent:
if ( killerrid == getcharid(3) ) end; // kill himself(like grandcross) doesn't add kills count.
if ( strcharinfo(3) != "guild_vs3","pvp_y_1-2","pvp_y_1-2" || (Class > 4000 && Class < 4023) || BaseLevel < 99) || JobLevel < 70) end; // Level 99/70 doesn't add kills and deaths count.
query_sql "insert into pvpladder values ( "+ getcharid(0) +", '"+ escape_sql( strcharinfo(0) ) +"', 1, 0, "+ class +" ) on duplicate key update kills = kills +1 ";
attachrid killedrid;
query_sql "insert into pvpladder values ( "+ getcharid(0) +", '"+ escape_sql( strcharinfo(0) ) +"', 0, 1, "+ class +" ) on duplicate key update deaths = deaths +1 ";
delwaitingroom; // continue read
OnInit:
if ( query_sql( "select name, kills, deaths, class from pvpladder order by kills desc limit 1", .@name$, .@kills, .@deaths, .@class ) )
 waitingroom .@name$ +" ("+ jobname(.@class) +") : "+ .@kills +" / "+ .@deaths, 0;
else
 waitingroom "PVP Ladder !", 0;
end;
}

Edited by Cisqua

2 answers to this question

Recommended Posts

Posted
if ( killerrid == getcharid(3) ) end; // kill himself(like grandcross) doesn't add kills count.
should be using killedrid instead
if ( strcharinfo(3) != "guild_vs3","pvp_y_1-2","pvp_y_1-2" || (Class > 4000 && Class < 4023) || BaseLevel < 99) || JobLevel < 70) end; // Level 99/70 doesn't add kills and deaths count.
if ( strcharinfo(3) != "guild_vs3" && strcharinfo(3) != "pvp_y_1-2" || !class || baselevel < 99 || joblevel < 70 )

more like this

change

    if ( killedrid == getcharid(3) ) end; // kill himself(like grandcross) doesn't add kills count.
   if ( strcharinfo(3) != "guild_vs3","pvp_y_1-2","pvp_y_1-2" || (Class > 4000 && Class < 4023) || BaseLevel < 99) || JobLevel < 70) end; // Level 99/70 doesn't add kills and deaths count.

into

if ( getgroupid() > 3 || killedrid == getcharid(3) || strcharinfo(3) != "guild_vs3" && strcharinfo(3) != "pvp_y_1-2" || !class || baselevel < 99 || joblevel < 70 ) end;

  • Upvote 1

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