AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   pulling out the knife (https://forums.alliedmods.net/showthread.php?t=6912)

svendude 10-18-2004 21:27

pulling out the knife
 
how do u make it so that when you pull out the knife something happenes, but when you switch to another weopon, it turns off the thing it did before?

DS 10-18-2004 22:27

Does this help?

Code:
public plugin_init() {     register_event("CurWeapon", "event_CurWeapon", "be", "2=29") } public event_CurWeapon(id) {     new isShown = read_data(1)         if (isShown) {         // Code here for when knife is pulled out     } else {         // Code here for when knife is put away     }         return PLUGIN_CONTINUE }

svendude 10-19-2004 04:06

w00t thx :)

ps: any1 remember me? no huh :(

svendude 10-19-2004 04:26

ok im a complete noob, but this is wat i got sofar, uncompiled or tested (btw wat is an index!?)

Code:
/* Hey i made this plugin for admins only. Also i'm pretty new to scripting so don't yell at me! */ #include <amxmodx> #include <amxmisc> #include <fun> public plugin_init(){     register_plugin("Scary knife","1.0","Carl/svendude")     register_concmd("amx_knife1","cmdknife",ADMIN_BAN) } public plugin_init() {     register_event("CurWeapon", "event_CurWeapon", "be", "2=29") } public event_CurWeapon(id) {     new isShown = read_data(1)           if (isShown) {         get_user_godmode(1)     } else {         get_user_godmode(2)     }           return PLUGIN_CONTINUE }

MC-Olivenoel 10-19-2004 05:52

hi

what is that "get_user_god(1)" ?? u want to know if user 1 has god ??


Code:
/* Hey i made this plugin for admins only. Also i'm pretty new to scripting so don't yell at me! */ #include <amxmodx> #include <amxmisc> #include <fun> public plugin_init(){     register_plugin("Scary knife","1.0","Carl/svendude")     register_event("CurWeapon", "event_CurWeapon", "be", "2=29") } public event_CurWeapon(id) {     if ((get_user_flags(id)&ADMIN_BAN)) {         new isShown = read_data(1)         if (isShown) {             set_user_godmode(id, 0)         } else {             set_user_godmode(id)         }     }     return PLUGIN_HANDLED }
i have not testet it ...

i think u dont need

register_concmd("amx_knife1","cmdknife",ADMIN _BAN)
---

do u want to turn it on/off ???

svendude 10-19-2004 06:33

yes, and im a total noob at this =/

MC-Olivenoel 10-19-2004 06:38

Quote:

Originally Posted by svendude
yes, and im a total noob at this =/

me too :wink:

svendude 10-19-2004 06:40

maby i should dump this and start small...


All times are GMT -4. The time now is 17:10.

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