Sigoles
Discord: @sigoles
- Joined
- Nov 20, 2015
- Messages
- 1,209
- Solutions
- 2
- Reaction score
- 154
I have this script:
I got this error, because the name have symbol:
And I want to put something like this (in C++):
Help to fix this please
Code:
function onKill(creature, target)
if target:isPlayer() and target:getLevel() >= 200 then
creature:setStorageValue(167912, math.max(0, creature:getStorageValue(167912)) + 1)
db.query("UPDATE `players` SET `frag_points` = `frag_points` + '1' WHERE `name` = '"..creature:getName().."';")
end
return true
end
I got this error, because the name have symbol:
And I want to put something like this (in C++):
Code:
std::ostringstream query;
std::string escapedName = Database::getInstance()->escapeString(getPlayerName());
query << "UPDATE `players` SET `frag_points`=`frag_points` + '1' WHERE
"<< escapedName << ", .............
Help to fix this please
Last edited by a moderator: