AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Client retry (https://forums.alliedmods.net/showthread.php?t=183170)

Killer zm 04-18-2012 11:24

Client retry
 
I need to do something :
When an player select something i want after 5 second to be reconnected

i'v made something like this

public retry_player(id)
{
client_cmd(id,"reconnect");
}

if he do something then he will bee reconnected

set_task(5.0, "retry_player");


But the problem is when that player do that thing then all players are reconnected not just him , how to make to be reconnected just him.

Devil259 04-18-2012 11:30

Re: Client retry
 
set_task(5.0, "retry_player", id);

Ortega 04-19-2012 09:34

Re: Client retry
 
Quote:

Originally Posted by Devil259 (Post 1691807)
set_task(5.0, "retry_player", id);

But you have to remember it isn't param of player index that it's only unique number of task to do. You can add to index your constant num and in callback decrease this value using the same num to obtain player index.

Devil259 04-19-2012 11:21

Re: Client retry
 
No, that works fine. Just one thing to add, check if user is connected in public retry_player() before doing anything.


All times are GMT -4. The time now is 07:53.

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