Xagul
deathzot.net
- Joined
- Jun 30, 2008
- Messages
- 1,295
- Solutions
- 3
- Reaction score
- 1,043
I have modified the script Cykotitan made for the in-game guild list, and I made it basically an in-game staff list. I am trying to learn sql queries so I do not have to ask for so much help and so far it seems I have got it figured out pretty good except the script I have here shows staff_name [group_id]. I tried to compare the returned group_id to a value and then define it as a word for the list to present like this:
When I do that it throws me an error saying
The script I am using currently due to the error is here:
Code:
if(list:getDataString("group_id") == 6) then
staffpos = "Administrator"
end
When I do that it throws me an error saying
Code:
attempt to concatenate global 'staffpos' <a nil value>
The script I am using currently due to the error is here:
Code:
function onSay(cid, words, param, channel)
if param == '' then
local list = db.getResult("SELECT `name`, `group_id` FROM `players` WHERE group_id > 1 ORDER BY `group_id`;")
if(list:getID() ~= -1) then
local v = ''
repeat
v = v .. list:getDataString("name") .. " [" .. list:getDataString("group_id") .. "]\n"
until not list:next()
list:free()
doShowTextDialog(cid, 2529, v)
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "There are no staff members.")
end
end
return true
end