AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Ugh (https://forums.alliedmods.net/showthread.php?t=28087)

FlashB@nG 05-06-2006 23:17

Ugh
 
Alright, The code works but not on admins with immunity and it shows in counsle "fun_godmode not found" or something like that.. here is code.

Code:
#include <amxmodx> #include <amxmisc> #include <fun> #include <cstrike> public plugin_init() {     register_plugin("FunMod","0.1","FkashBanG")     register_concmd("fun_help","fun_help", ADMIN_KICK, " : FunMod Help")     register_concmd("fun_glow","glow", ADMIN_KICK, " <player name> : Makes client glow!")       register_concmd("fun_godmode","godmode", ADMIN_KICK, " <player name> : Makes user not die!") } public glow(id,level,cid) {     new arg[24]         read_argv(1,arg,23)     new player = cmd_target(id, arg, 1)     if(!cmd_access(id,level,cid,2))     {         return PLUGIN_HANDLED     }     set_user_rendering(player,kRenderFxGlowShell,144,255,142,kRenderFxNone,0)     client_print(0,print_center,"[FunMod] Client %s is glowing!",player)     return PLUGIN_CONTINUE } public godmode(id,level,cid) {     new arg[24]         read_argv(1,arg,23)     new player = cmd_target(id, arg, 1)     if(!cmd_access(id,level,cid,2))     {         return PLUGIN_HANDLED     }     if(get_user_godmode(player) == 1) {         client_print(player, print_center, "[FunMod] Godmode is already enabled!")     }     else     {         set_user_godmode(player, 1)         client_print(player, print_center, "[FunMod] You have godmode enabled!",player)     }     return PLUGIN_CONTINUE } public connect(id) {     new arg[24]     read_argv(1,arg,23)     new player = cmd_target(id, arg, 1)     if(is_user_connecting(player)) {         client_print(0, print_center, "Beware! %s is joining the server!", player)     }     return PLUGIN_CONTINUE } public fun_help(id,level,cid) {     if(!cmd_access(id,level,cid,2)) {         return PLUGIN_HANDLED     }     client_print(id,print_console,"Commands:")     client_print(id,print_console,"fun_glow")     client_print(id,print_console,"fun_godmode")     client_print(id,print_console,"fun_help")     return PLUGIN_HANDLED }

Willmaker 05-07-2006 00:05

Code:
new player = cmd_target(id, arg, 1)
Just to clear things up, that "1" is what flags you want, and according to the funcwiki:

Flags:
1 - obey immunity
2 - allow yourself
4 - must be alive
8 - can't be bot

That might explain why it doesnt work on admins with immunity.

And with:
Code:
public godmode(id,level,cid) {     new arg[24]           read_argv(1,arg,23)     new player = cmd_target(id, arg, 1)     if(!cmd_access(id,level,cid,2))     {         return PLUGIN_HANDLED     }     if(get_user_godmode(player) == 1) {         client_print(player, print_center, "[FunMod] Godmode is already enabled!")     }     else     {         set_user_godmode(player, 1)         client_print(player, print_center, "[FunMod] You have godmode enabled!",player)     }     return PLUGIN_CONTINUE }

If you change the very last return PLUGIN_CONTINUE to PLUGIN_HANDLED, I believe it should get rid of the "fun_godmode not found" in the console.

FlashB@nG 05-07-2006 00:20

LOL
Just realized that :oops:
sorry :P thanks!!


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

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