Hi there, I'm currently using a script for PK Point System in my server.
The script goes like this.
If player 1 killed player 2. Player 1 will get 3 PK Points from Player 2, regardless if player 2 doesnt have enough PK Points to give.
In continuation, Player 2 loses 2 PK Points if he/she dies. But if he/she has less than 2 PK Point, he/she wont lose any point.
BUT!
If player 1 kills player 2 again, he SHOULD NOT GET any PK Point. And player 2 SHOULD NOT LOSE any PK Point either.
I believe my script has a 3 minutes Cooldown for antispam. But for an unknown reason, players are getting PK Points on every kill (without 3 minutes delay)
Can someone please fix my script. I don't really know what's wrong with the script at this moment.
Here's the script:
- script PK Point System -1,{
OnPCKillEvent:
if(strcharinfo(3) != "pvp_n_2-5") end;
if(@LastKilled == killedrid) end;
set .@Killer,getcharid(3);
set .@Killed,killedrid;
detachrid;
if(attachrid(.@Killed)){
if(#PKPOINTS){
if(#PKPOINTS <= 2) end;
set #PKPOINTS,#PKPOINTS-2;
dispbottom "You Lost 2 PK Point from "+rid2name(.@Killer);
dispbottom "Current PK Points : "+#PKPOINTS+" ";
detachrid;
if(attachrid(.@Killer)){
set #PKPOINTS,#PKPOINTS+3;
dispbottom "You Gained 3 PK Point from "+rid2name(.@Killed);
dispbottom "Current PK Points : "+#PKPOINTS+" ";
set @LastKilled,.@Killed;
attachnpctimer;
initnpctimer;
}
} else {
detachrid;
if(attachrid(.@Killer)){
//dispbottom "No PK Point to take from "+rid2name(.@Killed);
set #PKPOINTS,#PKPOINTS+3;
dispbottom "You Gained 3 PK Point from "+rid2name(.@Killed);
dispbottom "Current PK Points : "+#PKPOINTS+" ";
attachnpctimer;
initnpctimer;
}
}
}
end;
}
OnTimer180000:
set @LastKilled,0;
stopnpctimer;
detachnpctimer;
end;
}
Question
Yami
Hi there, I'm currently using a script for PK Point System in my server.
The script goes like this.
If player 1 killed player 2. Player 1 will get 3 PK Points from Player 2, regardless if player 2 doesnt have enough PK Points to give.
In continuation, Player 2 loses 2 PK Points if he/she dies. But if he/she has less than 2 PK Point, he/she wont lose any point.
BUT!
If player 1 kills player 2 again, he SHOULD NOT GET any PK Point. And player 2 SHOULD NOT LOSE any PK Point either.
I believe my script has a 3 minutes Cooldown for antispam. But for an unknown reason, players are getting PK Points on every kill (without 3 minutes delay)
Can someone please fix my script. I don't really know what's wrong with the script at this moment.
Here's the script:
Link to comment
Share on other sites
2 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.