Hello,
I have a problem with a command I created.
The syntax is as follow: "/setfaction Character_Name Faction_Id"
addCommandHandler("setfaction",
function (player, cmd, nom_cible, newfaction_id)
local query = "UPDATE 'characters' SET 'faction_id'='"..tonumber(newfaction_id).."' WHERE name="nom_cible" ;"
if (not mysql_query(MYSQL_serv,query)) then
outputDebugString("Error executing the query: (" .. mysql_errno(MYSQL_serv) .. ") " .. mysql_error(MYSQL_serv),1)
return false
else
outputDebugString(""..nom_cible.."a rejoint avec succès la faction "..newfaction_id.."",1)
end
end
)
It gives me the following error:
Error line 123(the line where the query is stored) attempt to call local 'nom_cible' (a string value)
Thank you for your help