Raised This Month: $ Target: $400
 0% 

could it be executed?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
jim_yang
Veteran Member
Join Date: Aug 2006
Old 09-08-2006 , 07:46   could it be executed?
Reply With Quote #1

Code:
 
public client_disconnect(id) {
        client_cmd(id, const cmd[])
        return PLUGIN_CONTINUE
}
could this command be executed to clients when they disconnect?
thanks
jim_yang is offline
Lord_Destros
Veteran Member
Join Date: Jul 2004
Location: With stupid.
Old 09-08-2006 , 08:24   Re: could it be executed?
Reply With Quote #2

You shouldn't be able to execute anything on a client once he disconnects.
__________________
Quote:
Originally Posted by Twilight Suzuka
Don't worry m'lord. The turtles day will come.
Lord_Destros is offline
Send a message via AIM to Lord_Destros
hmrsmpsn
Senior Member
Join Date: Nov 2005
Location: sWeDeN YEEAAAH!!!
Old 09-08-2006 , 15:41   Re: could it be executed?
Reply With Quote #3

i really think that sux how can you execute a function on a player on disconnect?

maybee register_concmd("drop", "function")
or whatever the command is to disconnect
this is evil HAHAHAH!
Code:
public plugin_init(){ register_concmd("drop", "function") } public function(id){ return PLUGIN_HANDLED }
__________________



new Float:second = 1.0
new Float:minute = 60*second
new Float:hour = 60*minute
new Float:day = 24*hour
new Float:year = 365*day
set_task(10.0*years,"clean_my_room")
hmrsmpsn is offline
teame06
i have a hat
Join Date: Feb 2005
Location: Hat City
Old 09-08-2006 , 16:06   Re: could it be executed?
Reply With Quote #4

You can't register_clcmd("disconnect", ... You can't execute stuff on a client on client_disconnect. By the time they are disconnected they are completely gone and you can't execute stuff onto client.
__________________
No private support via Instant Message
GunGame:SM Released
teame06 is offline
Send a message via AIM to teame06
hmrsmpsn
Senior Member
Join Date: Nov 2005
Location: sWeDeN YEEAAAH!!!
Old 09-08-2006 , 17:28   Re: could it be executed?
Reply With Quote #5

gaaaahhhhhhhhhhhhhhhhhhhhhhhh how to automaticly save xp!?!?!?! :O
__________________



new Float:second = 1.0
new Float:minute = 60*second
new Float:hour = 60*minute
new Float:day = 24*hour
new Float:year = 365*day
set_task(10.0*years,"clean_my_room")
hmrsmpsn is offline
Sophoclios
Junior Member
Join Date: Sep 2006
Old 09-08-2006 , 18:07   Re: could it be executed?
Reply With Quote #6

This is'nt possible as the way you do... You want to save the player's XP while he is disconnecting right ?

client_disconnect() function is being called when player disconnects... As theoricly , when a player is disconnected , you cannot make anything... But , in case , you can... Let me explain why...

In some servers , you see something like that , when a player is disconnecting :

"Johnson is disconnecting" So how does this work ? Thats why ;
When , a player trigger the disconnecting , just like writing disconnect to console , Counter Strike executes the command for disconnecting... I mean just like that

On aplayertriggersdisconnect {
execute this
execute that
disconnect player
}

The connection with server ends at the end of the code and execute this and execute that are executed... That happens very very fast and you cant understand... So , you can do it in client_disconnect , look : the function isnt client_disconnected ! it is client_disconnect ! It starts when a player triggers disconnecting and ENDS when a player is DISCONNECTED ! So it is excellent for saving something before player disconnect.
Sophoclios is offline
Zenith77
Veteran Member
Join Date: Aug 2005
Old 09-08-2006 , 18:09   Re: could it be executed?
Reply With Quote #7

*edit: Guy above me posted before me, what he said is correct (I think), but that's not the reason why.

XP is usually stored in an array, therefore you can still access the corresponding element of an array to the players server index, with or without the player being disconnected.

Code:
public client_disconnect(id) {      // Save XP...      // Reset... }
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred

Last edited by Zenith77; 09-08-2006 at 18:12.
Zenith77 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:17.


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