AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Respawn Round(Solved, Thx Exolent) (https://forums.alliedmods.net/showthread.php?t=75116)

AntiBots 07-30-2008 17:29

Respawn Round(Solved, Thx Exolent)
 
Hi friend I need some help.

I need that this respawn only work 10 seconds in the round start.

PHP Code:

public death_msg() 
{  
 {
  new 
vIndex read_data(2
  new 
svIndex[2]
  
svIndex[0] = vIndex
  set_task
(2.0,"respawn",0,svIndex,2
 } 
 return 
PLUGIN_CONTINUE 

public 
respawn(svIndex[]) 

 new 
vIndex svIndex[0
 if(
get_user_team(vIndex) == || is_user_alive(vIndex)) 
  return 
PLUGIN_CONTINUE 
 spawn
(vIndex
 
 return 
PLUGIN_CONTINUE    



AntiBots 07-30-2008 18:21

Re: Respawn Round
 
Is a player die in 10 second of the spawn, he respawn in 5 seconds

AntiBots 07-30-2008 19:45

Re: Respawn Round
 
hleV If you do plis put:
PHP Code:

cs_set_user_deathsidcs_get_user_deathsid ) + 


Exolent[jNr] 07-30-2008 23:33

Re: Respawn Round
 
Code:
#include <amxmodx> #include <fakemeta> #include <hamsandwich> #define RESPAWN_TIME 10.0 enum CsTeams {     CS_TEAM_UNASSIGNED = 0,     CS_TEAM_T,     CS_TEAM_CT,     CS_TEAM_SPECTATOR }; #define OFFSET_TEAM 114 #define OFFSET_DEATHS 444 #define cs_get_user_team(%1) get_pdata_int(%1, OFFSET_TEAM) #define cs_get_user_deaths(%1) get_pdata_int(%1, OFFSET_DEATHS) new bool:g_is_dead[33]; new bool:g_can_respawn; new g_msgid_ScoreInfo; public plugin_init() {     register_plugin("Respawn", "0.1", "Exolent");         RegisterHam(Ham_Killed, "player", "FwdPlayerDeath", 1);     RegisterHam(Ham_Spawn, "player", "FwdPlayerSpawn", 1);         register_logevent("EventRoundStart", 2, "1=Round_Start");         g_msgid_ScoreInfo = get_user_msgid("ScoreInfo"); } public client_putinserver(plr) {     g_is_dead[plr] = true;         set_task(5.0, "TaskCheckAlive", plr); } public client_disconnect(plr) {     remove_task(plr); } public TaskCheckAlive(plr) {     if( !g_can_respawn )     {         return;     }         new CsTeams:team = cs_get_user_team(plr);     if( team == CS_TEAM_UNASSIGNED || team == CS_TEAM_SPECTATOR )     {         set_task(1.0, "TaskCheckAlive", plr);                 return;     }         if( g_is_dead[plr] )     {         ExecuteHamB(Ham_CS_RoundRespawn, plr);     } } public FwdPlayerDeath(plr) {     g_is_dead[plr] = true;         set_task(0.1, "TaskCheckAlive", plr);         cs_set_user_deaths(plr, cs_get_user_deaths(plr) - 1); } public FwdPlayerSpawn(plr) {     if( is_user_alive(plr) && g_is_dead[plr] )     {         g_is_dead[plr] = false;     } } public EventRoundStart() {     g_can_respawn = true;         remove_task(123456);     set_task(RESPAWN_TIME * 60.0, "TaskDisableRespawn", 123456); } public TaskDisableRespawn() {     g_can_respawn = false; } cs_set_user_deaths(plr, deaths) {     set_pdata_int(plr, OFFSET_DEATHS, deaths);         new Float:frags;     pev(plr, pev_frags, frags);     Make_ScoreInfo(plr, floatround(frags), deaths, _, _:cs_get_user_team(plr)); } Make_ScoreInfo(plr, frags, deaths, classid=0, team) {     message_begin(MSG_ALL, g_msgid_ScoreInfo);     write_byte(plr);     write_short(frags);     write_short(deaths);     write_short(classid);     write_short(team);     message_end(); }

AntiBots 07-31-2008 00:23

Re: Respawn Round
 
Thank Exolent, but I have a problem.
I want to add:
PHP Code:

cs_set_user_deathsplrcs_get_user_deathsplr ) + 

</SPAN></SPAN>

But when I put the cstrike module the plugin give wrong thinks.

Posible to FIX.
+Karma Exolent :D The plugin work :D

Exolent[jNr] 07-31-2008 01:34

Re: Respawn Round
 
It will already add a death to the player since he dies then respawns.

AntiBots 07-31-2008 01:49

Re: Respawn Round
 
When a player die he got a death. I need to disable that score.
You stand me?

Exolent[jNr] 07-31-2008 01:59

Re: Respawn Round
 
Fixed.

AntiBots 07-31-2008 02:28

Re: Respawn Round
 
1 Attachment(s)
Thank You Are one of the best :D

But i can compiler

Exolent[jNr] 07-31-2008 03:33

Re: Respawn Round
 
Sorry, just a typo. Fixed.


All times are GMT -4. The time now is 05:33.

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