[REQ] Auto Godmode

Started by simpler
18/11/2008 19:41
Page 1 of 1
simpler18/11/2008 19:41

I've been trying to make a plugin like this on my own but it don't seems to work :/
I want a plugin that gives godmode automaticly on EVERY spawn, and it should alsp for each time it triggers put out a message for the players like "[Auto God]Godmode is now ON"

Please leave a full example about how you could write a script that does all that, i'm really thankfull // Phenom

simpler18/11/2008 21:41

i've fixed the plugin now :)
For everyone else that want a plugin that gives godmode on each spawn use this :


#include
#include
#include

#define PLUGIN "Auto Godmode"
#define AUTHOR "Phenom"
#define VERSION "1.0"

new amx_autogodmode

public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
amx_autogodmode = register_cvar("amx_autogodmode", "1")
RegisterHam(Ham_Spawn, "player", "PlayerSpawn", 1)
}
public PlayerSpawn(id) {
if(get_pcvar_num(amx_autogodmode) == 1 && get_user_godmode(id) == 0) {
set_user_godmode(id, 1);
client_print(id, print_chat, "[Auto Godmode] Now you have godmode.");
}
}




Lt.RAT18/11/2008 22:02(edited 18/11/2008 22:03)

we can do some improvements...
we dont need to use fun module for it... better to use "fakemeta_util.inc"

if u still havent it - better to find it :)

and copy-paste functions from it:

stock fm_get_user_godmode(index) {
new Float:val;
pev(index, pev_takedamage, val);

return (val == DAMAGE_NO);
}

stock fm_set_user_godmode(index, godmode = 0) {
set_pev(index, pev_takedamage, godmode == 1 ? DAMAGE_NO : DAMAGE_AIM);

return 1;
}

simpler19/11/2008 07:08

That's nice :)
Thanks!^^

Page 1 of 1

Please log in to post replies.