Raised This Month: $12 Target: $400
 3% 

Anti-Spawnkill God (V 1.0)


Post New Thread Reply   
 
Thread Tools Display Modes
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 06-22-2008 , 05:23   Re: Anti-Spawnkill God
Reply With Quote #11

My bad i gave you the wrong link.
http://forums.alliedmods.net/showthread.php?t=42159

Block fullupdate would work but it's not a proper solution.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Grinf4ce
Senior Member
Join Date: May 2006
Old 06-22-2008 , 05:39   Re: Anti-Spawnkill God
Reply With Quote #12

I fixed that bug now with the block solution, and work on the better solution.
Thank you for that link connorr, i will correct it soon with the proper solution with fakemeta.
__________________
Grinf4ce is offline
Grinf4ce
Senior Member
Join Date: May 2006
Old 06-22-2008 , 08:08   Re: Anti-Spawnkill God
Reply With Quote #13

I'm done..
No funmodule required anymore. I use fakemeta_util, like connorr saied.

But it cant compiled anymore with the boardcompiler? :S Local it works great. Whats wrong? :S

Updated to Version 0.3
__________________
Grinf4ce is offline
atomen
Veteran Member
Join Date: Oct 2006
Location: Stockholm, Sweden
Old 06-22-2008 , 09:17   Re: Anti-Spawnkill God
Reply With Quote #14

I think it's a little bit unnecessary to include fakemeta utility
when you can just use fakemeta.

I've fixed the script a bit (HamSandwich) :
Code:
#include <amxmodx> #include <hamsandwich> #include <fakemeta> #define gPLUGIN        "Anti-SpawnKill God" #define gVERSION        "0.4" #define gAUTHOR        "Grinf4ce" #define TASK_ID        33211 new SKG_MODE; new SKG_PROHP; new SKG_PROAP; new SKG_NORHP; new SKG_NORAP; new SKG_GLOW; new SKG_GLOW_R; new SKG_GLOW_G; new SKG_GLOW_B; new SKG_DELAY; public plugin_init() {     register_plugin(gPLUGIN, gVERSION, gAUTHOR);     RegisterHam(Ham_Spawn, "player", "Ham_Client_Spawn", 1);         SKG_MODE    = register_cvar("skg_mode","1");        /* Spawnkill-God Protect Mode - 1: Godmode ; 2 No God but more Protect-Health */         SKG_PROHP    = register_cvar("skg_protecthp","100");        /* Protect-HP if skg_mode is 2 */     SKG_PROAP    = register_cvar("skg_protectap","100");        /* Protect-AP if skg_mode is 2 */     SKG_NORHP    = register_cvar("skg_normalhp","100");        /* Start-HP if skg_mode is 2 */     SKG_NORAP    = register_cvar("skg_normalap","100");        /* Start-AP if skg_mode is 2 */         SKG_GLOW    = register_cvar("skg_glow","1");        /* Glow on Spawn for Delay-Time */     SKG_GLOW_R    = register_cvar("skg_glow_r","000");        /* Glowcolor in RGB: Red */     SKG_GLOW_G    = register_cvar("skg_glow_g","255");        /* Glowcolor in RGB: Green */     SKG_GLOW_B    = register_cvar("skg_glow_b","000");        /* Glowcolor in RGB: Blue */         SKG_DELAY    = register_cvar("skg_delay","5.0");        /* Spawnkill-God Protect-Delay in Seconds */ } public Ham_Client_Spawn(id) {     if(get_pcvar_num(SKG_MODE) == 1)         set_pev(id, pev_takedamage, 0);     else     {         set_pev(id, pev_health, get_pcvar_float(SKG_PROHP));         set_pev(id, pev_armorvalue, get_pcvar_float(SKG_PROAP))             }       if(get_pcvar_num(SKG_GLOW) == 1)         fm_set_rendering(id, kRenderFxGlowShell, get_pcvar_num(SKG_GLOW_R), get_pcvar_num(SKG_GLOW_G), get_pcvar_num(SKG_GLOW_B), kRenderNormal, 25);             set_task(get_pcvar_float(SKG_DELAY), "remove_effect", id + TASK_ID);     return HAM_IGNORED; } public remove_effects(task_id) {     new id = task_id - TASK_ID;     if(get_pcvar_num(SKG_MODE) == 1)         set_pev(id, pev_takedamage, 1);             /* Remove Player Godmode */     else     {         set_pev(id, pev_health, get_pcvar_num(SKG_NORHP))    /* Set User's Normal HP */         set_pev(id, pev_armorvalue, get_pcvar_num(SKG_NORAP))    /* Set User's Normal AP */     }             if(get_pcvar_num(SKG_GLOW) == 1)         fm_set_rendering(id)            /* Remove Glowing if enabled */ } fm_set_rendering(entity, fx = kRenderFxNone, r = 255, g = 255, b = 255, render = kRenderNormal, amount = 16) {     new Float:RenderColor[3];     RenderColor[0] = float(r);     RenderColor[1] = float(g);     RenderColor[2] = float(b);     set_pev(entity, pev_renderfx, fx);     set_pev(entity, pev_rendercolor, RenderColor);     set_pev(entity, pev_rendermode, render);     set_pev(entity, pev_renderamt, float(amount));     return FMRES_IGNORED; }
Script 2 (fakemeta only):
Code:
#include <amxmodx> #include <fakemeta> #define gPLUGIN        "Anti-SpawnKill God" #define gVERSION        "0.4" #define gAUTHOR        "Grinf4ce" #define TASK_ID        33211 new bool:g_pnss[33]; new g_ccp; new SKG_MODE; new SKG_PROHP; new SKG_PROAP; new SKG_NORHP; new SKG_NORAP; new SKG_GLOW; new SKG_GLOW_R; new SKG_GLOW_G; new SKG_GLOW_B; new SKG_DELAY; public plugin_init() {     register_plugin(gPLUGIN, gVERSION, gAUTHOR);     register_event("ResetHUD", "Reset_Hud", "b");     register_event("TextMsg", "Game_Restart", "a", "2=#Game_will_restart_in");     register_clcmd("fullupdate", "Cmd_Full_update");         SKG_MODE    = register_cvar("skg_mode","1");        /* Spawnkill-God Protect Mode - 1: Godmode ; 2 No God but more Protect-Health */         SKG_PROHP    = register_cvar("skg_protecthp","100");        /* Protect-HP if skg_mode is 2 */     SKG_PROAP    = register_cvar("skg_protectap","100");        /* Protect-AP if skg_mode is 2 */     SKG_NORHP    = register_cvar("skg_normalhp","100");        /* Start-HP if skg_mode is 2 */     SKG_NORAP    = register_cvar("skg_normalap","100");        /* Start-AP if skg_mode is 2 */         SKG_GLOW    = register_cvar("skg_glow","1");        /* Glow on Spawn for Delay-Time */     SKG_GLOW_R    = register_cvar("skg_glow_r","000");        /* Glowcolor in RGB: Red */     SKG_GLOW_G    = register_cvar("skg_glow_g","255");        /* Glowcolor in RGB: Green */     SKG_GLOW_B    = register_cvar("skg_glow_b","000");        /* Glowcolor in RGB: Blue */         SKG_DELAY    = register_cvar("skg_delay","5.0");        /* Spawnkill-God Protect-Delay in Seconds */ } public Reset_HUD(id) {         if (!is_user_alive(id))                 return;           if (g_pnss[id])     {                 g_pnss[id] = false;                 return;         }       Client_Spawn(id); }   public Game_Restart() {         static iPlayers[32], iPlayersNum, i;         get_players(iPlayers, iPlayersNum, "a");         for (i = 0; i < iPlayersNum; ++i)                 g_pnss[iPlayers[i]] = true; }   public Cmd_Full_update(id) {         g_pnss[id] = true;         static const szFwFmClientCommandPost[] = "Client_Cmd_Post";         g_ccp = register_forward(FM_ClientCommand, szFwFmClientCommandPost, 1);         return 0; }   public Client_Cmd_Post(id) {         unregister_forward(FM_ClientCommand, g_ccp, 1);         g_pnss[id] = false;         return FMRES_HANDLED; } public Client_Spawn(id) {     if(get_pcvar_num(SKG_MODE) == 1)         set_pev(id, pev_takedamage, 0);     else     {         set_pev(id, pev_health, get_pcvar_float(SKG_PROHP));         set_pev(id, pev_armorvalue, get_pcvar_float(SKG_PROAP))             }       if(get_pcvar_num(SKG_GLOW) == 1)         fm_set_rendering(id, kRenderFxGlowShell, get_pcvar_num(SKG_GLOW_R), get_pcvar_num(SKG_GLOW_G), get_pcvar_num(SKG_GLOW_B), kRenderNormal, 25);             set_task(get_pcvar_float(SKG_DELAY), "remove_effect", id + TASK_ID);     return 0; } public remove_effects(task_id) {     new id = task_id - TASK_ID;     if(get_pcvar_num(SKG_MODE) == 1)         set_pev(id, pev_takedamage, 1);             /* Remove Player Godmode */     else     {         set_pev(id, pev_health, get_pcvar_num(SKG_NORHP))    /* Set User's Normal HP */         set_pev(id, pev_armorvalue, get_pcvar_num(SKG_NORAP))    /* Set User's Normal AP */     }             if(get_pcvar_num(SKG_GLOW) == 1)         fm_set_rendering(id)            /* Remove Glowing if enabled */ } fm_set_rendering(entity, fx = kRenderFxNone, r = 255, g = 255, b = 255, render = kRenderNormal, amount = 16) {     new Float:RenderColor[3];     RenderColor[0] = float(r);     RenderColor[1] = float(g);     RenderColor[2] = float(b);     set_pev(entity, pev_renderfx, fx);     set_pev(entity, pev_rendercolor, RenderColor);     set_pev(entity, pev_rendermode, render);     set_pev(entity, pev_renderamt, float(amount));     return FMRES_IGNORED; } public Cmd_Full_update(id) return 2;
__________________

Last edited by atomen; 06-22-2008 at 10:08.
atomen is offline
Send a message via MSN to atomen
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 06-22-2008 , 09:33   Re: Anti-Spawnkill God
Reply With Quote #15

@atomen

Why at hell do you declare fm_set_rendering as a stock ?

Also, hamsandwich is not a good idea here.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Styles
Veteran Member
Join Date: Jul 2004
Location: California
Old 06-22-2008 , 09:35   Re: Anti-Spawnkill God
Reply With Quote #16

Atomen, why would you use HAM. Avoid it if you don't need to use it. Registering to hook the event is the best way. But nice job using pev_takedamage gj on that FakeMeta_Util was useless. And I hate to say it but wtf is with this damage crap? heh. And please, don't use set_task read hawks tutorial. You can create an entity that thinks or you can just hook FM_PlayerPreThink and then check and remove it otherwise, return fmres_ignored.
Styles is offline
Send a message via AIM to Styles
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 06-22-2008 , 09:36   Re: Anti-Spawnkill God
Reply With Quote #17

I don't see any problem using task in this case.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Styles
Veteran Member
Join Date: Jul 2004
Location: California
Old 06-22-2008 , 09:40   Re: Anti-Spawnkill God
Reply With Quote #18

I do.. heh, I hate them read hawks tut. I really would avoid using them.. I mean if an entity thinking is more efficient why not use it?
Styles is offline
Send a message via AIM to Styles
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 06-22-2008 , 09:43   Re: Anti-Spawnkill God
Reply With Quote #19

So read it again

-edit- this is a really bad place to discuss aboyt tasks
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Grinf4ce
Senior Member
Join Date: May 2006
Old 06-22-2008 , 09:45   Re: Anti-Spawnkill God
Reply With Quote #20

Now i'm confused What should i fix and correct now? :S
__________________
Grinf4ce is offline
Reply



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 07:10.


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