AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Help Me For this please. (https://forums.alliedmods.net/showthread.php?t=171376)

poliisi299 11-05-2011 07:46

Help Me For this please.
 
Help me plzz i need plugin.

plugin --> Terrorist can respawn but CT no can.

can someoney give me the plugin

Thank You

Korxu 11-05-2011 07:50

Re: Help Me For this please.
 
Check when a player die if he is a Terrorist, and respawn him.

poliisi299 11-05-2011 07:52

Re: Help Me For this please.
 
Quote:

Originally Posted by Korxu (Post 1590466)
Check when a player die if he is a Terrorist, and respawn him.

But i wan "T" automatically respawn can help ?

Korxu 11-05-2011 07:59

Re: Help Me For this please.
 
PHP Code:

// In plugin_init ( ), add this line.
     
RegisterHam Ham_Killed"player""ham_player_killed")

// Now, create the function.
public ham_player_killed index )
{
     if ( 
cs_get_user_team index ) == CS_TEAM_T )
     {
          
set_pev indexpev_deadflagDEAD_RESPAWNABLE )
          
// Or you can use other method, like this.
          // ExecuteHamB ( Ham_CS_RoundRespawn, index )
     
}



poliisi299 11-05-2011 08:03

Re: Help Me For this please.
 
Quote:

Originally Posted by Korxu (Post 1590473)
PHP Code:

// In plugin_init ( ), add this line.
     
RegisterHam Ham_Killed"player""ham_player_killed")
 
// Now, create the function.
public ham_player_killed index )
{
     if ( 
cs_get_user_team index ) == CS_TEAM_T )
     {
          
set_pev indexpev_deadflagDEAD_RESPAWNABLE )
          
// Or you can use other method, like this.
          // ExecuteHamB ( Ham_CS_RoundRespawn, index )
     
}



Thank you but can you send to Sma file ?

Korxu 11-05-2011 08:08

Re: Help Me For this please.
 
... you can't create the .sma file and compile it using the webcompiler?

sake 11-05-2011 08:18

Re: Help Me For this please.
 
Code:
/* * simple spawnPlayer method. spawns player. * credits: * <a href="https://forums.alliedmods.net/showpost.php?p=678294&postcount=19" target="_blank" rel="noopener">https://forums.alliedmods.net/showpo...4&postcount=19</a> */ public spawnPlayer(id) {     // Disconnected, already spawned, or switched to Spectator     if (!is_user_connected(id)     || is_user_alive(id)     || cs_get_user_team(id) == CS_TEAM_SPECTATOR     || cs_get_user_team(id) == CS_TEAM_UNASSIGNED)     {           return;     }     // Try to spawn the player setting the appropiate dead flag and forcing a think     set_pev(id, pev_deadflag, DEAD_RESPAWNABLE);     dllfunc(DLLFunc_Think, id);     // Fix for Bots: DLLFunc_Think won't work on them,     // but DLLFunc_Spawn does the job without any bugs.     if (is_user_bot(id) && pev(id, pev_deadflag) == DEAD_RESPAWNABLE)     {         dllfunc(DLLFunc_Spawn, id);     } }

I am using this one.

Korxu 11-05-2011 08:20

Re: Help Me For this please.
 
Is better than use only
PHP Code:

set_pev indexpev_deadflagDEAD_RESPAWNABLE 

or
PHP Code:

ExecuteHamB Ham_CS_RoundRespawnindex 

?

EDIT#
For your code, you can get the user team only one time and compare it to check if the user is spect or unassigned instead of get the user time two times.

poliisi299 11-05-2011 08:29

Re: Help Me For this please.
 
Quote:

Originally Posted by Korxu (Post 1590479)
... you can't create the .sma file and compile it using the webcompiler?

Not work :( i use this in my zombie plague mod but not work zombie not respawn plzz help me

poliisi299 11-05-2011 08:30

Re: Help Me For this please.
 
and i have zpa 1.6.1 and i use "zp_deathmatch 2" but not work :((


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

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