Respawn player on connect + welcome message
Mar 30, 2017 22:41:30 GMT
zmd94, Dragan015Bre, and 1 more like this
Post by Dragan015Bre on Mar 30, 2017 22:41:30 GMT
Hello members of ZPPV forum, I was afk on cs scene 1 year, but zmd94 didn't forget on me and he keep me my rank ZP Helper. I will posting every day tutorials and plugins Maybe 1 day I post Paranormal addons Let's start with tutorial.
Open your zombie_plague40.sma
Under the section
Find
and add
So it looks like this
The next part you will see that the // Client leaving, however add these 3 paragraphs before that work
- The first paragraph
- The second passage
You can change after how many seconds you want the player respawn
Only change this line if you want eg. 10 seconds after entering
And the last paragraph
- The third paragraph
Here print the message you want to see when a player respawn.
Of course, you can use the dhudmessage, but you'll need to add the plugin to include in the local compile.
That's it, I hope I help facilitate job searches around for respawns players.
Open your zombie_plague40.sma
Under the section
// Client joins the game
Find
// Load player stats?
if (get_pcvar_num(cvar_statssave)) load_stats(id)
and add
set_task( 3.0 , "respawn_welcome", id)
So it looks like this
// Load player stats?
if (get_pcvar_num(cvar_statssave)) load_stats(id)
set_task( 3.0 , "respawn_welcome", id)
The next part you will see that the // Client leaving, however add these 3 paragraphs before that work
- The first paragraph
// Respawn check
public respawn_welcome(id)
{
static team
team = fm_cs_get_user_team(id)
if( id )
{
if( is_user_connected(id) && !is_user_connecting(id) )
{
if (team == FM_CS_TEAM_SPECTATOR || team == FM_CS_TEAM_UNASSIGNED)
{
set_task( 1.0 , "respawn_welcome", id)
}
else
{
set_task( 1.0 , "paranormal_respawn_now", id)
}
}
else
{
set_task( 1.0 , "respawn_welcome", id)
}
}
else
{
new iPlayers[32], iNum
get_players(iPlayers, iNum, "c")
for(--iNum; iNum>=0; iNum--)
{
id = iPlayers[iNum]
if( !is_user_connecting(id) )
{
if (team == FM_CS_TEAM_SPECTATOR || team == FM_CS_TEAM_UNASSIGNED)
{
set_task( 1.0 , "respawn_welcome", id)
}
else
{
set_task( 1.0 , "paranormal_respawn_now", id)
}
}
else
{
set_task( 1.0 , "respawn_welcome", id)
}
}
}
}
- The second passage
// Respawn now
public paranormal_respawn_now(id)
{
if (!is_user_alive(id))
{
if(g_nemround)
{
set_task( 5.5 , "paranormal_welcome_text", id)
}
else if(g_survround)
{
set_task( 5.5 , "paranormal_welcome_text", id)
}
else if(g_plagueround)
{
set_task( 5.5 , "paranormal_welcome_text", id)
}
else
{
set_task( 5.5 , "paranormal_welcome_text", id)
set_task(3.0, "respawn_player_task", id+TASK_SPAWN)
}
}
}
You can change after how many seconds you want the player respawn
Only change this line if you want eg. 10 seconds after entering
set_task(10.0, "respawn_player_task", id+TASK_SPAWN)
And the last paragraph
- The third paragraph
public paranormal_welcome_text(id)
{
set_hudmessage(0, 125, 0, -1.0, 0.17, 1, 2.0, 2.0, 4.0, 2.0, -1)
ShowSyncHudMsg(id, g_MsgSync, "Welcome to Paranormal Zombie EvilNight!^n ADD IP TO FAVORITES: 87.98.241.203:27477")
}
Here print the message you want to see when a player respawn.
Of course, you can use the dhudmessage, but you'll need to add the plugin to include in the local compile.
That's it, I hope I help facilitate job searches around for respawns players.