Raised This Month: $ Target: $400
 0% 

Respawn Round(Solved, Thx Exolent)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 07-30-2008 , 23:33   Re: Respawn Round
Reply With Quote #5

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(); }
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!

Last edited by Exolent[jNr]; 07-31-2008 at 03:32.
Exolent[jNr] is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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