AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   When a player join late - HideNseeK (https://forums.alliedmods.net/showthread.php?t=62239)

flipz93 10-21-2007 14:20

When a player join late - HideNseeK
 
1 Attachment(s)
Hi! I have a question about the hidenseek plugin, made ny OneEyed.
When a player join Ts after the countdown have stopped they don't get the smoke and flashes (I have fixed so no one can get weapon). Is it possilbe to change the script so you can get smoke and flashes all the time on a round when you join T?

I think I need to change something there:
Quote:

public plugin_init() {
register_plugin("Hide n Seek", "1.0", "OneEyed")

if(!cvar_exists("hide_n_seek"))
register_cvar("hide_n_seek","0")
if(!cvar_exists("pub_type"))
register_cvar("pub_type","2")
if(!cvar_exists("hide_n_seek_timer"))
register_cvar("hide_n_seek_timer","10")

register_concmd("amx_begin", "startSeek", ADMIN_SLAY, "Starts Hide n Seek for Tournament")
register_concmd("amx_pub", "startPubSeek", ADMIN_SLAY, "Starts Hide n Seek for Pub")
register_concmd("amx_team", "setTeamName", ADMIN_SLAY, "<team # 1|2> <^"name^"> - Sets specific team name.")

register_logevent("StartRound",2,"0=World triggered", "1=Round_Start")
register_logevent("EndRound" ,2,"0=World triggered", "1=Round_Draw", "1=Round_End")

register_event("CurWeapon", "Switched", "be")
register_event( "ResetHUD", "resetHud", "be" )

round = 1
timer = get_cvar_num("hide_n_seek_timer")
overtime = 3
gmsgScreenFade = get_user_msgid("ScreenFade")
maxplayers = get_maxplayers()

//FakeEnt Thinking, (handles better with engine)
fakeEnt = create_entity("info_target")
entity_set_string(fakeEnt,EV_SZ_classname,"se rverFrame")
register_think("serverFrame","server_fakeFram e")

//Scoreboard thinking
scoreB = create_entity("info_target")
entity_set_string(scoreB,EV_SZ_classname,"sco reBoard")
register_think("scoreBoard","displayScoreBoar d")
}
And there:
Quote:

public StartRound() {
new t, c
for(new x=1;x<=maxplayers;x++) {
if(!is_user_connected(x)) continue
if(get_user_team(x) == 1) t = 1
if(get_user_team(x) == 2) c = 1
}
//Give team weapons on start round, and begin rounds
if(c == 1 && t == 1) {
if(get_cvar_num("hide_n_seek") == 1) {
if(round == 0) { // Knife Round Stuff
format(g_message,255,"Knife Round^nWinning Team will become [Hiders] first.")
for(new a=1;a<=maxplayers;a++) {
if(is_user_alive(a))
set_task(1.5,"stripAndGiveKnife",a)
}
set_hudmessage(255, 0, 0, -1.0, 0.5, 0, 1.0, 7.0, 0.1, 0.1, 4)
show_hudmessage(0,"%s",g_message)
entity_set_float(scoreB,EV_FL_nextthink,halfl ife_time() + 0.01)
}
if(round == 1) { // Begin Round 1 stuff
timer = get_cvar_num("hide_n_seek_timer")
entity_set_float(fakeEnt,EV_FL_nextthink,half life_time() + 0.01)
for(new a=1;a<=maxplayers;a++) {
if(get_user_team(a) == 1 && is_user_alive(a))
set_task(1.5,"HiderItems",a)
if(get_user_team(a) == 2 && is_user_alive(a))
set_task(1.5,"SeekerItems",a)
}
}
}
if(get_cvar_num("hide_n_seek") == 2) {
if(round >= 1) { // Begin Round 1 stuff
timer = get_cvar_num("hide_n_seek_timer")
entity_set_float(fakeEnt,EV_FL_nextthink,half life_time() + 0.01)
for(new a=1;a<=maxplayers;a++) {
if(get_user_team(a) == 1 && is_user_alive(a))
set_task(1.5,"HiderItems",a)
if(get_user_team(a) == 2 && is_user_alive(a))
set_task(1.5,"SeekerItems",a)
}
}
}
}
}
And there:
Quote:

public resetHud(id) {
if(is_user_alive(id) && get_cvar_num("hide_n_seek") > 0) {
cs_set_user_money(id, 0)
new args[1]
args[0] = id
set_task(5.0,"modelCheck",1234,args,1,"a",0)
}
}

mordi 10-21-2007 15:58

Re: When a player join late - HideNseeK
 
You need to call the event that gives weapons on player spawn instead of StartRound.

flipz93 10-22-2007 10:48

Re: When a player join late - HideNseeK
 
Quote:

Originally Posted by mordi (Post 544797)
You need to call the event that gives weapons on player spawn instead of StartRound.

And how do I do that ? :wink: I am not good at scripting. Plz write what I got to change.

flipz93 10-25-2007 11:04

Re: When a player join late - HideNseeK
 
Plz someone, help me!

DaKo 06-29-2008 16:33

Re: When a player join late - HideNseeK
 
1 Attachment(s)
Yes, it's possible. Try this. :wink:


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

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