AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [Request] error msg: client_disconnect is already defined (https://forums.alliedmods.net/showthread.php?t=18001)

Riddick51 09-13-2005 14:17

[Request] error msg: client_disconnect is already defined
 
1 Attachment(s)
u can see on line 1820 that i have used client_disconnect a second time. if u quickie search, you will see that i have another client_disconnect inside of an "if" statement.

can u suggest a fix for me?

MistaGee 09-13-2005 14:38

make the client_disconnect on line 1830 look like this:
Code:
public client_connect(id) {     plist[id] = 0 // just to make sure #if defined DISPLAY_MSG     remove_task(id) #endif }

and delete the first one... I never tried this so I don't know if it will work or what it's gonna do, it's just a basic idea.

Greetz MGee

Riddick51 09-13-2005 14:52

Quote:

Originally Posted by MistaGee
make the client_disconnect on line 1830 look like this:
Code:
public client_connect(id) {     plist[id] = 0 // just to make sure #if defined DISPLAY_MSG     remove_task(id) #endif }

and delete the first one... I never tried this so I don't know if it will work or what it's gonna do, it's just a basic idea.

Greetz MGee

ok, i'm a small noob, so tell me if i am in error. you used the client_connect for your enhancement, did u mean to use the following:
Code:
public client_disconnect(id) {     if (plist[id] == 1)     {         new team = get_user_team(id)         awsm_count[team]--     }     //G. MGee: next 3 lines added to fix duplicate client_disconnect     #if defined DISPLAY_MSG         remove_task(id)     #endif     plist[id] = 0 }
and i removed the first one as you mentioned.

MistaGee 09-14-2005 05:16

sounds good to me... if it works, problem solved 8)

Greetz MGee

WaZZeR++ 09-14-2005 06:02

im not sure you can check his team, because when you get his id, he has allready leave...

MistaGee 09-14-2005 11:50

Quote:

Originally Posted by WaZZeR++
when you get his id, he has allready leave...

is this correct? I think your script gets the information that the player wants to leave before the HL engine does, so the player waits for your script to be OK with it before he is diconnected... Well that's what I think, not sure if it's correct.

I'd say just test it, but if your function doesn't work, you will have a clue why :P

Greetz MGee


All times are GMT -4. The time now is 14:35.

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