From 5aa1f7177bc5e6345cd2e15f94f7ff9835e2f138 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Mon, 2 Jul 2018 19:42:10 -0300 Subject: Add an extra function so ref_prog works with disconnected players --- npc/functions/clientversion.txt | 2 +- npc/functions/main.txt | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'npc') diff --git a/npc/functions/clientversion.txt b/npc/functions/clientversion.txt index 22c0c476a..cf2b424db 100644 --- a/npc/functions/clientversion.txt +++ b/npc/functions/clientversion.txt @@ -27,7 +27,7 @@ function script checkclientversion { debugmes "Hercules is bugged: "+.@ref$; mes ""; if (.@ref$ != "") { - .@ref=getcharid(3, strip(.@ref$)); + .@ref=gf_accid(strip(.@ref$)); if (.@ref > 0) { if (.@ref == getcharid(3)) { mesn l("TMW2 Staff"); diff --git a/npc/functions/main.txt b/npc/functions/main.txt index bf4ee2cde..6d1c3762c 100644 --- a/npc/functions/main.txt +++ b/npc/functions/main.txt @@ -235,6 +235,13 @@ function script isin { return false; } +// Get some acc id, even if offline +// ( Name ) +function script gf_accid { + .@nb = query_sql("SELECT `char`.account_id WHERE `char`.name='"+escape_sql(getarg(0))+"' LIMIT 2", .@value); + return .@value[0]; +} + function script getquestlink { return "[@@q" + getarg(0) + "|@@]"; } -- cgit v1.2.3-70-g09d2