Tbol
Well-Known Member
- Joined
- Apr 7, 2019
- Messages
- 526
- Reaction score
- 54
Hello
using action script that should remove all of my kills and my current white skull or red skull if i have one. It removes white skull fine (didnt tested with red skull) but it doesnt remove my stored kills that i have
and after using my frag remover it stays the same
but it should set all of my kills to 0, day, week, month, but it doesnt remove shitt
This is action script.
Info from src that maybe might help idk
using action script that should remove all of my kills and my current white skull or red skull if i have one. It removes white skull fine (didnt tested with red skull) but it doesnt remove my stored kills that i have
Code:
You currently have 1 frags today, 1 this week and 1 this month.
but it should set all of my kills to 0, day, week, month, but it doesnt remove shitt
This is action script.
Lua:
local cooldown = 5 --time in seconds
function onUse(player, item, fromPosition, itemEx, toPosition, isHotkey)
if player:getExhaustion(Storage.FragRemoverCooldown) then
player:sendCancelMessage("You are on cooldown.")
return false
end
if player:getSkull() ~= SKULL_NONE then
player:setSkull(SKULL_NONE)
end
player:setPlayerKillerEnd(0)
player:setExhaustion(Storage.FragRemoverCooldown, cooldown)
player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Your frags has been removed!")
db.query("UPDATE `player_deaths` SET `unjustified` = 0 WHERE `unjustified` = 1 AND `killed_by` = " .. db.escapeString(player:getName()))
item:remove(1)
return true
end
Info from src that maybe might help idk
C++:
for (auto kill : player->kills) {
query.str(std::string());
query << "INSERT INTO `player_kills` (`player_id`, `victim_id`, `time`) VALUES (" << player->getGUID() << "," << std::get<0>(kill) << "," << std::get<1>(kill) << ");";
if (!db->executeQuery(query.str())) {
return false;
}
}
C++:
//load kills
query.str(std::string());
query << "SELECT `victim_id`,`time` FROM `player_kills` WHERE `player_id` = " << player->getGUID();
if ((result = db->storeQuery(query.str()))) {
do {
player->kills.push_back(std::make_pair(result->getNumber<uint32_t>("victim_id"), result->getNumber<uint64_t>("time")));
} while (result->next());
}