AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Prevent spawn after roundstart (https://forums.alliedmods.net/showthread.php?t=84393)

padilha007 01-25-2009 10:26

Prevent spawn after roundstart
 
i need a exemple to prevent spawn after round start to block "Game Commencing"

Exolent[jNr] 01-25-2009 13:42

Re: Prevent spawn after roundstart
 
Try this:
Code:
#include <amxmodx> #include <amxmisc> #include <hamsandwich> new bool:g_round_started; public plugin_init() {     register_logevent("EventRoundStart", 2, "1=Round_Start");     register_logevent("EventRoundEnd", 2, "1=Round_End");     register_event("TextMsg", "EventRoundEnd", "a", "2=#Game_Commencing", "2=#Game_will_restart_in");         RegisterHam(Ham_Spawn, "player", "FwdPlayerSpawn", 1); } public EventRoundStart() {     g_round_started = true; } public EventRoundEnd() {     g_round_started = false; } public FwdPlayerSpawn(client) {     if( g_round_started )     {         user_silentkill(client);     } }

padilha007 01-25-2009 20:17

Re: Prevent spawn after roundstart
 
don't work =/

BOYSplayCS 01-25-2009 22:41

Re: Prevent spawn after roundstart
 
Could you provide further details on why it didn't work? Like, an error message?

Are you 100% sure you have the hamsandwich module running?

Exolent[jNr] 01-25-2009 22:56

Re: Prevent spawn after roundstart
 
I don't think you can block spawning.
But, you can slay after spawning.
Code updated.

padilha007 01-25-2009 23:23

Re: Prevent spawn after roundstart
 
but before slay the event is activated no?

Dores 01-26-2009 09:47

Re: Prevent spawn after roundstart
 
Quote:

Originally Posted by padilha007 (Post 750244)
but before slay the event is activated no?

Yes. Why do you need to block the whole event?
Don't you just want to prevent the player from playing?

padilha007 01-26-2009 10:30

Re: Prevent spawn after roundstart
 
my mod transfer all players to terrorists on roundstart, so if anyone go to ct the event start.

Dores 01-26-2009 11:49

Re: Prevent spawn after roundstart
 
Quote:

Originally Posted by padilha007 (Post 750439)
my mod transfer all players to terrorists on roundstart, so if anyone go to ct the event start.

Is that what you need?

Code:
#include <amxmodx> #include <fakemeta> #include <hamsandwich> #define OFFSET_TEAM    114 new g_Msg_TeamInfo; public plugin_init() {     RegisterHam(Ham_Spawn, "player", "Forward_Spawn");         g_Msg_TeamInfo = get_user_msgid("TeamInfo"); } public Forward_Spawn(id) {     if(get_user_team(id) != 1)     {         fm_set_user_team(id, 1);     } } fm_set_user_team(index, team) {     set_pdata_int(index, OFFSET_TEAM, team);     dllfunc(DLLFunc_ClientUserInfoChanged, index, engfunc(EngFunc_GetInfoKeyBuffer, index));         message_begin(MSG_ALL, g_Msg_TeamInfo);     write_byte(index);     static Teams[][] =     {         "", // LOL NULL         "TERRORIST",         "CT",         "SPECTATOR"     }     write_string(Teams[team]);     message_end(); }

padilha007 01-26-2009 12:07

Re: Prevent spawn after roundstart
 
no my mod do that. but tnx for all and +K


All times are GMT -4. The time now is 01:45.

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