Raised This Month: $94 Target: $400
 23% 

Task frame


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   Technical/Development        Approver:   Exolent[jNr] (178)
MPNumB
Veteran Member
Join Date: Feb 2007
Location: Lithuania
Old 04-25-2009 , 00:09   Task frame
Reply With Quote #1

Description:
Since 2009/Aprile/20 Half-Life update "_special" scripts no longer work. For some of us it's maybe needed to test some things for plugins what we are willing to create.


Usege:
task_frames <frame number> <command> - executes a command line in selected amount of frames.

For example I used this code to test is silent-run working in "Counter-Strike 1.6 Beta":
Code:
bind MOUSE3 +silentrun
 
alias +silentrun "silentrun;alias sr silentrun"
alias -silentrun "alias sr"
 
alias silentrun "duck_1;duck_2;duck_3;duck_4;duck_5"
alias duck_1 "task_frames 1 +duck"
alias duck_2 "task_frames 2 -duck"
alias duck_3 "task_frames 22 +duck"
alias duck_4 "task_frames 24 -duck"
alias duck_5 "task_frames 32 sr"


Additional info:
Tested with amxmodx 1.8.1 on Counter-Strike 1.6.


Note:
Command can be executed only on person who started a lan game, or only in hlsd console if server is dedicated.


Change-Log:

* 1.0
- First release.
Attached Files
File Type: sma Get Plugin or Get Source (task_frames.sma - 1067 views - 1.9 KB)
__________________
Skill and no annoying bugs with fixed balance issues is my goal!
My approved plugins what don't show up in Approved List:
* Bomb/Death/CSS Radar
* HotVision
___
Need help? Please check this documentation first.

Last edited by MPNumB; 04-25-2009 at 14:25.
MPNumB is offline
Send a message via Skype™ to MPNumB
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
Old 04-25-2009 , 00:17   Re: Task frame
Reply With Quote #2

Sounds good...

Nice job
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS is offline
alan_el_more
Veteran Member
Join Date: Jul 2008
Location: amxmodx-es.com
Old 04-25-2009 , 09:31   Re: Task frame
Reply With Quote #3

nice... +k
__________________
alan_el_more is offline
M1R0n,M'
Senior Member
Join Date: Jan 2009
Location: Lithuania
Old 04-25-2009 , 10:33   Re: Task frame
Reply With Quote #4

client_print(MPNumB, print_chat, " GOOD JOB ");
__________________
PHP Code:
#include <hambeer>
RegisterHamBeer(HamBeer_Spawn"player""GivePlayerBeer"1);
public 
GivePlayerBeer(Pl){
    if(!
is_user_alive(Pl)){
        
ham_give_beer(Pl5)
        
client_print(Plprint_chat"Go Go Go"){


Last edited by M1R0n,M'; 04-25-2009 at 11:00.
M1R0n,M' is offline
minimiller
Veteran Member
Join Date: Aug 2007
Location: United Kingdom
Old 04-25-2009 , 10:44   Re: Task frame
Reply With Quote #5

Quote:
Originally Posted by M1R0n,M' View Post
client_print(0, print_chat, " GOOD JOB ");
Why are you printing the message to all players (0)?
Index is a players index from 0 - Number of last thread post
Try this:
client_print(1, print_chat, " GOOD JOB ");

Joke dude ;)
Nice plugin numb
__________________
minimiller is offline
Send a message via MSN to minimiller
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 04-25-2009 , 13:35   Re: Task frame
Reply With Quote #6

Nice job!
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
MPNumB
Veteran Member
Join Date: Feb 2007
Location: Lithuania
Old 04-25-2009 , 14:24   Re: Task frame
Reply With Quote #7

There is a little difference in client_print and console_print. console_print(0, "text") prints "text" to the server console. client_print(0, print_console, "text") prints "text" to all clients.

But ya, good that you noticed that. Changed console_print to server_print there also - will take less CPU.

P.S. Not adding in changelog and not updating version cuz changes aren't that big.
__________________
Skill and no annoying bugs with fixed balance issues is my goal!
My approved plugins what don't show up in Approved List:
* Bomb/Death/CSS Radar
* HotVision
___
Need help? Please check this documentation first.
MPNumB is offline
Send a message via Skype™ to MPNumB
SchlumPF*
Veteran Member
Join Date: Mar 2007
Old 04-25-2009 , 15:32   Re: Task frame
Reply With Quote #8

client_print(MPNumB, print_chat, " GOOD JOB "); will give you an error cuz MPNumB is aundefined var. use this:
client_print(find_player("aj", "MPNumB", print_chat, " GOOD JOB ");
__________________

Last edited by SchlumPF*; 04-25-2009 at 15:59.
SchlumPF* is offline
Send a message via ICQ to SchlumPF*
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 04-25-2009 , 15:35   Re: Task frame
Reply With Quote #9

This is more accurate
PHP Code:
new iNumb find_player"aj""MPNumB" );

client_printiNumbprint_chat"GOOD JOB :D" ); 
__________________
xPaw is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 04-25-2009 , 15:39   Re: Task frame
Reply With Quote #10

Quote:
Originally Posted by SchlumPF* View Post
client_print(find_player("a", "MPNumB", print_chat, " GOOD JOB ");
Quote:
Originally Posted by xPaw View Post
This is more accurate
PHP Code:
new iNumb find_player"aj""MPNumB" );

client_printiNumbprint_chat"GOOD JOB :D" ); 
How? It does the same thing.

You could do this:
Code:
static MPNumB;
if( (MPNumB = find_player("aj", "MPNumB")) )
    client_print(MPNumB, print_chat, "GOOD JOB! :D");
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Reply


Thread Tools
Display Modes

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 23:23.


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