Raised This Month: $ Target: $400
 0% 

[TF2]


Post New Thread Reply   
 
Thread Tools Display Modes
FaTony
Veteran Member
Join Date: Aug 2008
Old 05-02-2010 , 09:49   Re: [TF2]
Reply With Quote #11

Hook player_spawn event.
FaTony is offline
Patilus
Member
Join Date: Jun 2009
Location: France
Old 05-02-2010 , 10:01   Re: [TF2]
Reply With Quote #12

It's this!
Thank you very much!
Patilus is offline
Patilus
Member
Join Date: Jun 2009
Location: France
Old 05-02-2010 , 12:07   Re: [TF2]
Reply With Quote #13

One more thing on timers =)

For this script, the action is at the end of time :
PHP Code:
public OnPluginStart()
{
    
CreateTimer(5.0LoadStuff)
}
 
public 
Action:LoadStuff(Handle:timer)
{
    
PrintToServer("Loading stuff!")

How to make the action happens during the time?
Patilus is offline
Scone
Senior Member
Join Date: Apr 2010
Location: England
Old 05-02-2010 , 12:27   Re: [TF2]
Reply With Quote #14

Like this:

PHP Code:
public OnPluginStart()
{
    
PrintToServer("Loading stuff!");
    
// Load stuff here

Or have I mistaken you?
__________________
Scone is offline
Patilus
Member
Join Date: Jun 2009
Location: France
Old 05-02-2010 , 13:00   Re: [TF2]
Reply With Quote #15

Humm, it'll be too easy =)

If the timer is set is that it is not finished, so I send my order,
as thou hast shown, the command is sent directly without taking into account the timer.

PHP Code:
public OnPluginStart()
{
    
CreateTimer(5.0LoadStuff)
}

 
// During the timer
IF (LoadStuff exist not finish)
{
    
PrintToServer("Loading stuff!");
}

// At the end of the timer
public Action:LoadStuff(Handle:timer)
{
    
KillTimer(LoadStuff);


Last edited by Patilus; 05-02-2010 at 13:05.
Patilus is offline
Patilus
Member
Join Date: Jun 2009
Location: France
Old 05-02-2010 , 15:46   Re: [TF2]
Reply With Quote #16

Anyone know how to do the "During the timer"?
Patilus is offline
Scone
Senior Member
Join Date: Apr 2010
Location: England
Old 05-02-2010 , 15:55   Re: [TF2]
Reply With Quote #17

What are you trying to achieve (overall) with this?
__________________
Scone is offline
Patilus
Member
Join Date: Jun 2009
Location: France
Old 05-02-2010 , 16:03   Re: [TF2]
Reply With Quote #18

A Class Time Limit

=> I started a timer on all the players who uses the class "sniper"
=>
At the end of this counter, the player is changing class

Until then, this has everything works, now I want to create a second timer at the end of the first so that the player can not return to Class "sniper" to the end of this second counter.

Because the sniper is limited on my server, it will rotate the sniper

Last edited by Patilus; 05-02-2010 at 16:10.
Patilus is offline
Scone
Senior Member
Join Date: Apr 2010
Location: England
Old 05-02-2010 , 17:15   Re: [TF2]
Reply With Quote #19

So when a player changes to the sniper class you want to:
- Allow them to be a sniper for X minutes
- After this, force them to change class and not allow them to be sniper for Y minutes
This needs to be broken up into smaller pieces:
- Hook the player_changeclass event
- When they change to sniper:
- If they haven't been sniper yet, or we are past the end of time Y, start timing (i.e. we are now at the start of time X) and allow them to change
- Else, if we are in time X, allow them to change
- Else, if we are in time Y, stop them from changing
- Create one timer, expiring at the end of X, to force them to change class to something else
Keep track of the different times using GetTime() in the hook (i.e. save the time at which they became sniper in a global array, use the difference between now and then to see how long they've been sniper), rather than relying on timers too much.

If you don't have much programming experience, this plugin might be a challenge
__________________
Scone is offline
Patilus
Member
Join Date: Jun 2009
Location: France
Old 05-02-2010 , 17:22   Re: [TF2]
Reply With Quote #20

This plugin is challenge for me ... it's my first plugin

But I research several years ago, I applied, and nothing has emerged ...
So I'm trying to assembled small pieces ... and he left the stage to the timer Y to finish my project.
Patilus 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 14:38.


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