I am trying to create the script below that counts the kills depending on the faction that the killer and the victim belong to. It’s actually quite simple and obvious.
However, I’m not having success with the part where it checks if the players are in the same faction. It seems that the problem lies in killedrid, which is not correctly setting the char_id.
Quote
- script SistemaKillFaccoes -1,{
OnPCKillEvent:
if (strcharinfo(3) != "guild_vs3") { end; }
set .@killer, getcharid(0);
set .@killed, killedrid;
query_sql "SELECT faction FROM `char` WHERE char_id = " + .@killer + ";", .@killer_faction;
query_sql "SELECT faction FROM `char` WHERE char_id = " + .@killed + ";", .@killed_faction;
if (.@killer_faction == .@killed_faction) {
query_sql "UPDATE faction_kills SET mortes = mortes - 2 WHERE faction_id = " + .@killer_faction + ";";
dispbottom "--- Você matou um membro da própria Facção [-2 pontos] -----";
end;
}
if (.@killer_faction == 1 || .@killer_faction == 2) {
query_sql "UPDATE faction_kills SET mortes = mortes + 1 WHERE faction_id = " + .@killer_faction + ";";
dispbottom "----- Você eliminou um membro da Facção inimiga [+1 ponto] -----";
}
end;
}
Question
serjtk
Hey guys,
I am trying to create the script below that counts the kills depending on the faction that the killer and the victim belong to. It’s actually quite simple and obvious.
However, I’m not having success with the part where it checks if the players are in the same faction. It seems that the problem lies in
killedrid
, which is not correctly setting thechar_id
.Link to comment
Share on other sites
1 answer 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.