AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   set_user_time can do that? (https://forums.alliedmods.net/showthread.php?t=192788)

0920357689 08-14-2012 03:15

set_user_time can do that?
 
only have get_user_time to get player playing time
but how to set it?

OvidiuS 08-14-2012 07:00

Re: set_user_time can do that?
 
Quote:

Originally Posted by 0920357689 (Post 1771000)
only have get_user_time to get player playing time
but how to set it?

You have to add this function:
http://forums.alliedmods.net/showthread.php?t=135873
and then to recompile amxmodx.

Waleed 08-14-2012 07:05

Re: set_user_time can do that?
 
I think this should work
Code:
static cell AMX_NATIVE_CALL set_user_time(AMX *amx, cell *params) /* set_user_time(id,time) 0-all, seconds*/ {   int index = params[1];   if (index<1||index>gpGlobals->maxClients)     return 0;   CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);   if (pPlayer->ingame){     float time = amx_ctof(params[2]);     float connecttime = pPlayer->playtime - pPlayer->time;     pPlayer->playtime = gpGlobals->time - time;     pPlayer->time = pPlayer->playtime - connecttime;     return 1;   }   return 0; }
Refrence:http://forums.alliedmods.net/showthread.php?t=135873

0920357689 08-14-2012 07:58

Re: set_user_time can do that?
 
but I don't know how to recompile amxmodx

avril-lavigne 08-14-2012 08:32

Re: set_user_time can do that?
 
get source first

0920357689 08-14-2012 16:03

Re: set_user_time can do that?
 
get source first will be auto recompile amxmodx????


All times are GMT -4. The time now is 05:49.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.