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

Common Issues and Examples/Solutions


Post New Thread Reply   
 
Thread Tools Display Modes
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 06-26-2010 , 06:19   Re: Common Issues and Examples/Solutions
Reply With Quote #11

Time since round began:

PHP Code:
#define get_timeofround()     (get_gametime() - gF_reference)

new Float:gF_reference

public plugin_init()
{
    
register_logevent"ev_roundstart"2"1=Round_Start" )
}

public 
ev_roundstart()
{
    
gF_reference get_gametime()

__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.
ot_207 is offline
Devil259
Veteran Member
Join Date: Dec 2009
Location: France (59)
Old 06-26-2010 , 06:26   Re: Common Issues and Examples/Solutions
Reply With Quote #12

Quote:
Originally Posted by ot_207 View Post
Time since round began:

PHP Code:
#define get_timeofround()     (get_gametime() - gF_reference)
 
new Float:gF_reference
 
public plugin_init()
{
    
register_logevent"ev_roundstart"2"1=Round_Start" )
}
 
public 
ev_roundstart()
{
    
gF_reference get_gametime()

With that, you can do :

client_print(id, print_chat, "The round began for %d secondes/minutes ??", gF_reference)

It's seconds or minutes ?
__________________
You can do anything you set your mind to, man.

Devil259 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-26-2010 , 09:51   Re: Common Issues and Examples/Solutions
Reply With Quote #13

Quote:
Originally Posted by Devil259 View Post
It's seconds or minutes ?
Seconds.
__________________
fysiks is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 06-26-2010 , 09:55   Re: Common Issues and Examples/Solutions
Reply With Quote #14

And it's a float not an integer.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Devil259
Veteran Member
Join Date: Dec 2009
Location: France (59)
Old 06-26-2010 , 11:38   Re: Common Issues and Examples/Solutions
Reply With Quote #15

Ok thank you for the information.
__________________
You can do anything you set your mind to, man.

Devil259 is offline
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 06-26-2010 , 20:41   Re: Common Issues and Examples/Solutions
Reply With Quote #16

This is really simple but, for some people that want to do something at the first spawn only, or at the first event (round start, or whatever):

Code:
#include <amxmodx> #include <hamsandwich> #define PLUGIN  "First Spawn" #define AUTHOR  "Alucard" #define VERSION "0.0.1" new bool:FirstSpawn[33]; public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR);     RegisterHam(Ham_Spawn, "player", "HookPlrSpawn", 1); } public client_connect(id)     FirstSpawn[id] = true; public HookPlrSpawn(id) {     if(FirstSpawn[id])     {         // do stuff here, that you only want         // to do at the first spawn                 FirstSpawn[id] = false;     } }
__________________
Approved Plugins - Steam Profile

Public non-terminated projects:
All Admins Menu, HLTV parameters, Subnick,
Second Password (cool style), InfoZone,
Binary C4 plant/defuse, and more...

Private projects:
NoSpec (+menu), NV Surf Management,
PM Adanved System, KZ longjump2, and more...
Alucard^ is offline
Send a message via Skype™ to Alucard^
Devil259
Veteran Member
Join Date: Dec 2009
Location: France (59)
Old 07-04-2010 , 15:37   Re: Common Issues and Examples/Solutions
Reply With Quote #17

Can you add the best way of coding a semiclip ?

Thank you in advance.
__________________
You can do anything you set your mind to, man.

Devil259 is offline
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 07-05-2010 , 02:51   Re: Common Issues and Examples/Solutions
Reply With Quote #18

Quote:
Originally Posted by Devil259 View Post
Can you add the best way of coding a semiclip ?

Thank you in advance.
Just use the coderiz method...
__________________
Approved Plugins - Steam Profile

Public non-terminated projects:
All Admins Menu, HLTV parameters, Subnick,
Second Password (cool style), InfoZone,
Binary C4 plant/defuse, and more...

Private projects:
NoSpec (+menu), NV Surf Management,
PM Adanved System, KZ longjump2, and more...
Alucard^ is offline
Send a message via Skype™ to Alucard^
Devil259
Veteran Member
Join Date: Dec 2009
Location: France (59)
Old 07-05-2010 , 05:52   Re: Common Issues and Examples/Solutions
Reply With Quote #19

Ok
__________________
You can do anything you set your mind to, man.

Devil259 is offline
t3hNox
Senior Member
Join Date: Oct 2009
Old 07-06-2010 , 14:17   Re: Common Issues and Examples/Solutions
Reply With Quote #20

Hah, I have asked for some of the things listed on the first post.
For beginners these samples of code may be VERY helpful.

An offtopic question: what "%" exactly does ?
PHP Code:
public LogEventRoundStart()
{
    if( ( ++
iRound ROUND_INTERVAL ) == )
        
// do whatever you need to do here

Code from round interval sample.
t3hNox 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 22:31.


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