From 855df4fb01d20f19091d18d46980b5fdfa95a712 Mon Sep 17 00:00:00 2001 From: raphael12333 <130972077+raphael12333@users.noreply.github.com> Date: Tue, 18 Apr 2023 19:15:18 +0200 Subject: [PATCH] new feature get unixtime in gsc (#15) intended usage for temporary banning --- src/inc.h | 1 + src/script.c | 5 +++++ src/script.h | 1 + src/symbs.txt | 1 + 4 files changed, 8 insertions(+) diff --git a/src/inc.h b/src/inc.h index 8f3b410..e7dba2e 100644 --- a/src/inc.h +++ b/src/inc.h @@ -168,6 +168,7 @@ extern x##_t x #define GScr_getconfigstring xtn_GScr_getconfigstring #define GScr_configstringindex xtn_GScr_configstringindex #define GScr_system xtn_GScr_system +#define GScr_getUnixTime xtn_GScr_getUnixTime #define SV_Trace xtn_SV_Trace #define sv_maxRate xtn_sv_maxRate #define GScr_getSite xtn_GScr_getSite diff --git a/src/script.c b/src/script.c index 0684161..cc0c7eb 100644 --- a/src/script.c +++ b/src/script.c @@ -197,6 +197,10 @@ void GScr_system(int a) { #endif } +void GScr_getUnixTime() { + Scr_AddInt(time(NULL)); +} + void Scr_GetArrayKeys(int a); void Scr_PassArray(int); @@ -278,6 +282,7 @@ SCRIPTFUNCTION scriptFunctions[] = { {"getconfigstring", GScr_getconfigstring, 0}, {"configstringindex", GScr_configstringindex, 0}, {"system", GScr_system, 0}, + {"getunixtime", GScr_getUnixTime, 0}, {NULL, NULL, 0} }; diff --git a/src/script.h b/src/script.h index 2e3ef09..db6acd6 100644 --- a/src/script.h +++ b/src/script.h @@ -368,6 +368,7 @@ void GScr_salt_password(int a1); void GScr_getconfigstring(int); void GScr_configstringindex(int); void GScr_system(int); +void GScr_getUnixTime(); void GScr_strpos(int); void GScr_SpawnAnimEnt(int); diff --git a/src/symbs.txt b/src/symbs.txt index 4098a5a..0411f26 100644 --- a/src/symbs.txt +++ b/src/symbs.txt @@ -171,6 +171,7 @@ #define GScr_getconfigstring xtn_GScr_getconfigstring #define GScr_configstringindex xtn_GScr_configstringindex #define GScr_system xtn_GScr_system +#define GScr_getUnixTime xtn_GScr_getUnixTime #define SV_Trace xtn_SV_Trace #define sv_maxRate xtn_sv_maxRate #define GScr_getSite xtn_GScr_getSite