AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   join team event (https://forums.alliedmods.net/showthread.php?t=17694)

atambo 09-07-2005 00:13

join team event
 
is there an event for joining a team? like if someone joins t or ct?

atambo 09-07-2005 00:42

"TextMsg"

ok I found that event and I can check if a player joins t or ct...but is there anyway to check to see if they have chosen a model for t or ct before I spawn them? because if I just register the event with them picking t or ct then if they arn't fast enough they will respawn without picking a model and be in counter-strike limbo :?

Xanimos 09-07-2005 01:21

What is this for? Ive edited a plugin for someone that fixed the respawn bug that they dont get respawned. and it doesnt do it till they have chosen a team. but its not a specific event.

atambo 09-07-2005 01:28

well I'm looking for a regular respawn plugin that will not only respawn people when they die but also respawn them when they join the server after they pick a team...so far I dont see any that actually work without somekind of timer...like what if someone went spectator but then joined a team later on...I would like something that will be nice and reliable so that I can always know that with respawn on everyone is alive if they want to be

XxAvalanchexX 09-07-2005 01:45

From the Team Locker plugin by bardelot (ported by karamellz):

Code:
#define KEY_T       0 #define KEY_CT      1 #define KEY_AUTO    4 #define KEY_SPEC    5 public plugin_init() {    register_menucmd(register_menuid("Team_Select"),(1<<0)|(1<<1)|(1<<4)|(1<<5),"team_select") } public team_select(id,key) {    if(key == KEY_T || key == KEY_CT || key == KEY_AUTO) {       // they joined a team presumably    } }

v3x 09-07-2005 03:41

What about for class select? ;)

atambo 09-07-2005 07:25

thats going to be the same as the "TextMsg" event telling me when they join a team but not when they pick a skin or class or whatever and are ready to spawn :?

does anyone know what cs_get_user_model returns if they haven't picked one yet? :P

Hawk552 09-07-2005 07:46

Code:
register_event("TextMsg","join_respawn","a","1=1","2&Game_join_te","2&Game_join_ct")

And I've already done what you're looking to do.

atambo 09-07-2005 07:48

ahh then what do you do in the join_respawn function? just have a timer and spawn them?

Hawk552 09-07-2005 07:51

Here's the exact way I used it:

Code:
public join_respawn() {     if(surfmap == false)     {         return PLUGIN_CONTINUE     }     if(get_cvar_num("surf_on")==0)     {         return PLUGIN_CONTINUE     }     if(get_cvar_num("surf_respawn")==0)     {         return PLUGIN_CONTINUE     }         new arg[32]     read_data(3,arg,31)         new id = cmd_target(1,arg,0)         // Spawn the player twice to avoid the HL engine bug     set_task(0.5,"player_spawn",id)     set_task(0.7,"player_spawn",id)         // Then give them a suit and a knife     set_task(0.9,"player_giveitems",id)         return PLUGIN_CONTINUE }
Code:
public player_spawn(id) {     spawn(id) }
Code:
public player_giveitems(id) {     give_item(id, "item_suit")     give_item(id, "weapon_knife")         return PLUGIN_CONTINUE }

It's actually taken partly from Geesu's Respawn Forever, but the joining on connect was added by me.


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

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