ich habe eine pvp rangliste ein gebaut aber bekomme ne fehler meldung
SYSERR: Jul 20 21:46:29 :: RunState: LUA_ERROR: [string "pvp_kills_rank"]:12: attempt to call global `say_red' (a nil value)
SYSERR: Jul 20 21:46:29 :: WriteRunningStateToSyserr: LUA_ERROR: quest pvp_kills_rank.select_kills click
PHP
- quest pvp_kills_rank begin
- state start begin
- when login begin
- local pid = mysql_query("select id from player.player where name='"..pc.get_name().."' LIMIT 1")
- table.foreachi(pid,function(i,l)
- pc.setqf("pid", l[1])
- end)
- local set = mysql_query("INSERT INTO pvp_kills (name, kills, pid) VALUES ('"..pc.get_name().."', 0, "..pc.getqf("pid")..")")
- pc.setqf("pvp_kills_rank", 0)
- set_state(select_kills)
- end
- end
- state select_kills begin
- when login begin
- local get1 = mysql_query("select name from pvp_kills where pid= "..pc.getqf("pid").." LIMIT 1")
- if get1 ~= pc.get_name() then
- mysql_query("UPDATE pvp_kills SET name = '"..pc.get_name().."' WHERE pid = '"..pc.getqf("pid").."' LIMIT 1")
- end
- end
- when kill with npc.is_pc() begin
- mysql_query("UPDATE pvp_kills SET kills = kills+1 WHERE pid = '"..pc.getqf("pid").."' LIMIT 1")
- pp = mysql_query("select name,kills from pvp_kills ORDER BY kills desc LIMIT 15")
- table.foreachi(pp,function(i,l)
- if l[1]== pc.get_name() then
- if pc.getqf("pvp_kills_rank") ~= i then
- pc.setqf("pvp_kills_rank", i)
- chat("Du bist nun auf Rang "..i.." der PvP Rangliste")
- if i==1 then
- notice_all(pc.get_name().." ist nun auf Platz 1 der PvP Rangliste")
- end
- end
- end
- end)
- end
- when 20263.chat."PvP-Rangliste" begin
- say_title("Ranglisten")
- say("Was möchtest du tun?")
- local s = select("Gesamte Liste", "Mein Rang", "Spieler suchen", "Abbrechen")
- if s == 4 then
- return
- end
- if s == 1 then
- pp = mysql_query("select name,kills from pvp_kills ORDER BY kills desc LIMIT 15")
- say("Rang - Name - Kills")
- pc.setqf("pvp_kills_rank",0)
- table.foreachi(pp,function(i,l)
- say_red(i.." - "..l[1].." - "..l[2])
- end)
- elseif s == 2 then
- pp = mysql_query("select name,kills from pvp_kills where pid="..pc.getqf("pid").." ORDER BY kills desc LIMIT 1")
- say_title("Mein Rang")
- say("Rang - Name - Kills")
- pc.setqf("pvp_kills_rank",0)
- table.foreachi(pp,function(i,l)
- say_red(i.." - "..l[1].." - "..l[2])
- end)
- elseif s == 3 then
- say_title("Spieler suchen")
- say("Gib den Namen des zu suchenden ein")
- local name = input()
- if name == '' then
- say_title("Fehler")
- say("Das Eingabefeld ist leer")
- else
- pp = mysql_query("select name,kills from pvp_kills where name='"..name.."' ORDER BY kills desc LIMIT 1")
- say_title("Spieler suchen")
- say("Rang - Name - Kills")
- pc.setqf("pvp_kills_rank",0)
- table.foreachi(pp,function(i,l)
- say_red(i.." - "..l[1].." - "..l[2])
- end)
- end
- end
- end
- end
- end