Raised This Month: $ Target: $400
 0% 

[HELP] to write func


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
preepunk
Member
Join Date: Jul 2009
Location: Universe, Milky Way
Old 08-20-2010 , 12:38   [HELP] to write func
Reply With Quote #1

Here is the code of get_user_time, so if i call it it will return time that player spent on the server

Code:
static cell AMX_NATIVE_CALL get_user_time(AMX *amx, cell *params) /* get_user_time(id,flag) 0-all, 1 without connected*/
{
  int index = params[1];
  if (index<1||index>gpGlobals->maxClients)
    return 0;
  CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
  if (pPlayer->ingame){
    int time = (int)(gpGlobals->time - (params[2] ? pPlayer->playtime : pPlayer->time));
    return time;
  }
  return 0;
}
I need to modify it and to get a
set_user_time
so that i will set_user_time(id,flag,time_in_seconds)
i know that i should use ENTITY_SET_KEYVALUE
but i really dont know how
please help its not so difficult 2 you)
PM or there

Last edited by preepunk; 08-20-2010 at 12:45.
preepunk is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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