• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Exec SQL

Can I use:
Code:
update players set skillid="7" where name = " .. db.escapeString(getCreatureName(cid)) .. ";
???

The skill 7 is MINEWORKER skill... I need to add this skill to player on my database... help-me
 
Code:
function addSpecialSkill(cid, var)
	local tmpGuid = getPlayerGUID(cid)
	doRemoveCreature(cid)
	db.executeQuery("UPDATE `player_skills` SET `value` = `value` + ".. var .." WHERE `player_id` = '".. tmpGuid .."' AND `skill_id` = 8;")
	return true
end
 
Last edited:
it's easier if you use storages for storing skill levels ..
why would you store it in player_skills if you can't make it show as a new bar in client either way?
 
@Cyk~
I made this skill on sources...

@Choj~
"var" is the skill id?
Can I use:
Code:
function addSpecialSkill(cid, var)
 local tmpGuid = getPlayerGUID(cid)
  doRemoveCreature(cid)
  db.executeQuery("UPDATE `player_skills` SET `value` = `value` + ".. var .." wHERE `player_id` = '".. tmpGuid .."';")
 return true
end

function onLogin(cid)
 local storage = 123456789
  if getPlayerStorageValue(cid, storage) <= 0 then
   local SKILL_MINEWORKER = 8
    addSpecialSkill(cid, SKILL_MINEWORKER)
   setPlayerStorageValue(cid, storage, 1)
  end
 return TRUE
end
?
 
No, if you added it in sources, database and vocations.xml properly .. this should work:
Code:
local SKILL_MINEWORKER, storage = 8, 30001
function onLogin(cid)
	if getPlayerStorageValue(cid, storage) < 1 then
		doPlayerAddSkill(cid, SKILL_MINEWORKER, 1)
		setPlayerStorageValue(cid, storage, 1)
	end
	return true
end
 
Back
Top