diff options
author | gepard1984 <gepard1984@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-02-15 00:34:32 +0000 |
---|---|---|
committer | gepard1984 <gepard1984@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-02-15 00:34:32 +0000 |
commit | 70b60d3c8215ec5470f1ca0a6a2441168730b5eb (patch) | |
tree | e83c53cd8baba4fcd86bfdc930ec3610deab04d0 /src | |
parent | c3c7efd8b1332095ff723230a813539600896e35 (diff) | |
download | hercules-70b60d3c8215ec5470f1ca0a6a2441168730b5eb.tar.gz hercules-70b60d3c8215ec5470f1ca0a6a2441168730b5eb.tar.bz2 hercules-70b60d3c8215ec5470f1ca0a6a2441168730b5eb.tar.xz hercules-70b60d3c8215ec5470f1ca0a6a2441168730b5eb.zip |
Added `getgroupid()` script command (follow-up to r15572).
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15583 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r-- | src/map/script.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/map/script.c b/src/map/script.c index 14c3ae6d9..8fdefe2c2 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -7350,6 +7350,21 @@ BUILDIN_FUNC(getgmlevel) return 0; } +/// Returns the group ID of the player. +/// +/// getgroupid() -> <int> +BUILDIN_FUNC(getgroupid) +{ + TBL_PC* sd; + + sd = script_rid2sd(st); + if (sd == NULL) + return 1; // no player attached, report source + script_pushint(st, pc_get_group_id(sd)); + + return 0; +} + /// Terminates the execution of this script instance. /// /// end @@ -15978,6 +15993,7 @@ struct script_function buildin_func[] = { BUILDIN_DEF(getgdskilllv,"iv"), BUILDIN_DEF(basicskillcheck,""), BUILDIN_DEF(getgmlevel,""), + BUILDIN_DEF(getgroupid,""), BUILDIN_DEF(end,""), BUILDIN_DEF(checkoption,"i"), BUILDIN_DEF(setoption,"i?"), |