Hello,
I've been using this forum for a while now along my brother and still haven't made an account :embarassed: Anyways, him and I attempted to code a Race/Faction changer. It seems that it doesn't execute the actual SQL Query or if it does when the player gets kicked, it gets overridden?
We have been stumped for quite a while about this and would like any assistance at all :smile:
EDIT: If the GUID is set to default value other than the current player's GUID it works without a flaw. Might've also wanted to pointed that out
I've been using this forum for a while now along my brother and still haven't made an account :embarassed: Anyways, him and I attempted to code a Race/Faction changer. It seems that it doesn't execute the actual SQL Query or if it does when the player gets kicked, it gets overridden?
We have been stumped for quite a while about this and would like any assistance at all :smile:
Code:
--[[
Race Change Script
Developed for CMaNGOS 2.4.3
Developers: Grim, Render1982
]]
local NPC_ENTRY = 60010
function ChangeRaceMenu(event, player, unit)
if player:GetGender() == 0 then
player:GossipMenuAddItem(0, "Change Race to Orc", 0, 1)
-- else
-- player:GossipMenuAddItem(0, "Change Race to Human", 0, 2)
end
player:GossipMenuAddItem(0, "Nevermind..", 0, 3)
player:GossipSendMenu(1, unit)
end
function ChangeRaceSelect(event, player, unit, sender, intid, code)
if (intid == 1) then
player:KickPlayer()
CharDBQuery("UPDATE `characters`.`characters` SET `race`=2 WHERE `guid`="..player:GetGUIDLow()..";")
-- elseif (intid == 2) then
-- elseif (intid == 3) then
end
end
RegisterCreatureGossipEvent(NPC_ENTRY, 1, ChangeRaceMenu)
RegisterCreatureGossipEvent(NPC_ENTRY, 2, ChangeRaceSelect)
EDIT: If the GUID is set to default value other than the current player's GUID it works without a flaw. Might've also wanted to pointed that out
Last edited: