AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   pause / bind pause (https://forums.alliedmods.net/showthread.php?t=147145)

BIGR 01-05-2011 18:47

pause / bind pause
 
Hi,
i need help with pause.

I check admincmd.sma where is a good function of pause, but it's for new cmd.
I create function for pause with some conditons, but i need optimise.
I would send cmd pause, and now run my fuction with some conditons (minimum connection time, ...).



cmd pause and run fuction OR check bind and set bind pause

1) cmd pause block
Code:

public plugin_init()
{
register_clcmd("pause","func_test")
register_clcmd("func_pause","func_test")
}

public func_test(id)
{
client_print(id,print_chat,"It is great !")
return PLUGIN_CONTINUE
//but if I send cmd pause, this function not run
}

2) When it will not do. I need check client bind pause.
I test it with function query_client_cvar().
Every my test: Bad CVAR request



3) else if you are dont help me, i must hard send for client this and use func_pause
Code:

public client_putinserver(id)
{
set_task(15.0, "set_pause", id)
}

public set_pause(id)
{
client_cmd(id, "bind ^"pause^" ^"func_pause; pause^"")
}

But it's not good, becouse somebody don't have bind "pause" "pause". :(




sorry my english is bad :D

Thanks, BIGR.

BIGR 01-07-2011 14:44

Re: pause / bind pause
 
refresh, please some answer

drekes 01-07-2011 16:14

Re: pause / bind pause
 
1. I don't see anything wrong with that code, only the return is not needed.
2. It's not possible to get a client's binds.
3. That's slowhacking and is not allowed here.

BIGR 01-08-2011 02:53

Re: pause / bind pause
 
drekes:
1) allow cmd pause after 60s, but as? its ok for cmd func_pause
Code:

new time = 0

public func_test(id)
{
time=get_user_time(id)

if (time < 60)
{
client_print(id, print_chat, "before 60s - func pause test")
return PLUGIN_HANDLED;
}
else
{
client_print(id, print_chat, "after 60s - func pause test")
client_cmd(id, "pause")
}
return PLUGIN_CONTINUE
}

2,3) Thanks for answer.

BIGR 01-08-2011 19:29

Re: pause / bind pause
 
refresh, please some answer about 1)

drekes 01-08-2011 21:54

Re: pause / bind pause
 
What exactly do you want the plugin to do ?
It's a bit unclear to me. What does the pause command do ?

BIGR 01-08-2011 23:08

Re: pause / bind pause
 
cmd pause, if you server cvars pausable is 1, it's paused the game. I dont know, what I must write about standart fuction pause.

drekes 01-09-2011 00:48

Re: pause / bind pause
 
I tried this, and my console said i paused the game, but it doesn't seem to do anything.

BIGR 01-09-2011 10:48

Re: pause / bind pause
 
I need some dev. :(
Becouse I dont know, How I can edit client cmd pause.

You can run fuction on any other commands (usp, buy, ...) but pause ?


All times are GMT -4. The time now is 02:12.

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