Raised This Month: $51 Target: $400
 12% 

[REQ] Play Time


Post New Thread Reply   
 
Thread Tools Display Modes
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 01-09-2018 , 23:10   Re: [REQ] Play Time
Reply With Quote #41

Quote:
Originally Posted by khashayar007 View Post
There are two errors in compiling
PHP Code:
nvault_array.inc(42) : error 021symbol already defined"nvault_set_array"
nvault_array.inc(80) : error 021symbol already defined"nvault_get_array" 
I did not realize that this conflict existed when using both include files. I will update the include threads with the fix but for now you can use the attached.
Attached Files
File Type: inc nvault_util.inc (6.7 KB, 50 views)
File Type: inc nvault_array.inc (7.6 KB, 44 views)
__________________

Last edited by Bugsy; 01-10-2018 at 00:08.
Bugsy is offline
khashayar007
Senior Member
Join Date: Jan 2015
Location: Macedonia
Old 01-10-2018 , 12:21   Re: [REQ] Play Time
Reply With Quote #42

Thanks the errors have gone. But there is a big problem, this version always show the playtime 0. I even played near 2 hours but It was 0 and didn't save it. The previous version doesn't have this problem.

Last edited by khashayar007; 01-10-2018 at 12:21.
khashayar007 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 01-10-2018 , 19:11   Re: [REQ] Play Time
Reply With Quote #43

Quote:
Originally Posted by khashayar007 View Post
Thanks the errors have gone. But there is a big problem, this version always show the playtime 0. I even played near 2 hours but It was 0 and didn't save it. The previous version doesn't have this problem.
Above code has been fixed. I also did some time formatting instead of displaying seconds. If you want, you should set the amount of time needed to get VIP into a CVar and you can then make it say "Play 2 days to get VIP" or "Play X days/hours/minutes/seconds more to get VIP"
__________________

Last edited by Bugsy; 01-10-2018 at 20:20.
Bugsy is offline
khashayar007
Senior Member
Join Date: Jan 2015
Location: Macedonia
Old 01-11-2018 , 04:16   Re: [REQ] Play Time
Reply With Quote #44

Whenever a player connects the message "You have played for %s. Play more to get VIP!" shows. I want it to be shown whenever a round starts. Can you change it to that? I think client_authorized must change to fwdSpawn.
khashayar007 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 01-11-2018 , 17:29   Re: [REQ] Play Time
Reply With Quote #45

  • Should it re-check playtime every round to determine if the player gets VIP?
  • What if the player already has VIP at round start, should it repeatedly show their play time and that they have VIP every round?
  • Do you like the way the time is formatted, or do you prefer hours/minutes only. Should it show remaining time needed to get VIP in the same format?
__________________

Last edited by Bugsy; 01-11-2018 at 17:29.
Bugsy is offline
khashayar007
Senior Member
Join Date: Jan 2015
Location: Macedonia
Old 01-12-2018 , 02:01   Re: [REQ] Play Time
Reply With Quote #46

Quote:
Originally Posted by Bugsy View Post
  • Should it re-check playtime every round to determine if the player gets VIP?
  • What if the player already has VIP at round start, should it repeatedly show their play time and that they have VIP every round?
  • Do you like the way the time is formatted, or do you prefer hours/minutes only. Should it show remaining time needed to get VIP in the same format?
  • No, don't check playtime every round to determine if the player gets VIP.
  • No, If the player is already VIP don't show anything every round.
  • Yes, It should show remaining time needed to get VIP every round in minutes format.

Last edited by khashayar007; 01-12-2018 at 02:01.
khashayar007 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 01-12-2018 , 18:10   Re: [REQ] Play Time
Reply With Quote #47

Above plugin is updated
__________________
Bugsy is offline
khashayar007
Senior Member
Join Date: Jan 2015
Location: Macedonia
Old 01-13-2018 , 08:20   Re: [REQ] Play Time
Reply With Quote #48

Thanks everything is fine but I found a bug. If a player is already VIP it still shows message play more to get VIP.
khashayar007 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 01-13-2018 , 12:00   Re: [REQ] Play Time
Reply With Quote #49

Quote:
Originally Posted by khashayar007 View Post
Thanks everything is fine but I found a bug. If a player is already VIP it still shows message play more to get VIP.
I'm not having this problem when testing, and I don't see how it's possible.

Connecting
PHP Code:
            if ( g_pdDataid ][ pdPlayTime ] >= FortyEightHours )
            {
                
set_user_flagsid ADMIN_LEVEL_F );
                
g_pdDataid ][ pdIsVIP ] = true;
            } 
New round
PHP Code:
        if ( g_pdDataiPlayer ][ pdIsVIP ] == false )
        {
            
iSecondsNeededForVIP FortyEightHours - ( g_pdDataiPlayer ][ pdPlayTime ] + ( get_systime() - g_pdDataiPlayer ][ pdConnectTime ] ) );
            
            
FormatTimeiSecondsNeededForVIP szTime charsmaxszTime ) );
            
            
client_printiPlayer print_chat "* You must play an additional %s to get VIP." szTime );
        } 
__________________
Bugsy is offline
khashayar007
Senior Member
Join Date: Jan 2015
Location: Macedonia
Old 01-13-2018 , 13:57   Re: [REQ] Play Time
Reply With Quote #50

I meant if the player is VIP via users.ini the plugin doesn't recognize that the player is already VIP.

Last edited by khashayar007; 01-13-2018 at 13:58.
khashayar007 is offline
Reply



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 21:15.


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