Hi.. i would like some help with a lua script.

10/11/2012 19:25 dante196#1
I got this..
Code:
  when letter with pc.is_gm() begin
And i want something like this :
Code:
when letter with pc.is_gm('IMPLEMENTOR') begin
Explanation : I would like this command in this script to allow only IMPLEMENTOR autorithy
to use it. Not GOD / HIGH WIZ / Low wiz to use it.
11/11/2012 17:39 AslTracker#2
Poti incerca ceva de genul:
with pc.is_gm() begin if pc.get_name() == "[GA]Edan" or pc.get_name() == "[SGA]Edan" then


You can try:
with pc.is_gm() begin if pc.get_name() == "[GA]" or pc.get_name() == "[SGA]" then
11/11/2012 18:23 .Alessa#3
Quote:
when letter with pc.is_gm() begin
local gamerights = mysql_query("SELECT mAuthority FROM common.gmlist WHERE id='"..pc.get_accountid().."'")
if gamerights != "IMPLEMENTOR" then
return
end
For this you need to add the following function:
Quote:
function pc.get_accountid(c1)
local b5 = mysql_query("SELECT account_id FROM player.player WHERE player.name='"..c1.."'")
return tonumber(b5[1])
end
This should do it. Alternatively (and I think it's a little bit easier) you can use AslTracker's solution. Just check the name and compare it with your administrators.