AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Map Weapon Touch Pickup (https://forums.alliedmods.net/showthread.php?t=327449)

Ynet 09-19-2020 08:11

Map Weapon Touch Pickup
 
kind of hard to explain what i am talking about which is why i made a video of the thing i want to hook onto

https://youtu.be/Y7sqivxOAm4

all i need is a way to hook onto the object and the player who used it, the rest i can i do my self

functions i have tried to register touch in order to block with no success

"trigger_push"
"trigger_hurt"
"trigger_teleport"
"func_wall_toggle"
"func_weapons"
"func_weapon"

Black Rose 09-19-2020 09:16

Re: Map Weapon Touch Pickup
 
You can hook FM_Touch which will trigger on everything and print the classnames. That way you will find out pretty quick.

Code:
public plugin_init() {     register_forward(FM_Touch, "Touch") } //... public Touch(toucher, touched) {     new classname[32];     pev(touched, pev_classname, classname, charsmax(classname));     server_print("Touched %s", classname); }

Ynet 09-19-2020 11:11

Re: Map Weapon Touch Pickup
 
Quote:

Originally Posted by Black Rose (Post 2718185)
You can hook FM_Touch which will trigger on everything and print the classnames. That way you will find out pretty quick.

Code:
public plugin_init() {     register_forward(FM_Touch, "Touch") } //... public Touch(toucher, touched) {     new classname[32];     pev(touched, pev_classname, classname, charsmax(classname));     server_print("Touched %s", classname); }

that's a good idea i am checking it out now

Edit: didn't work

Natsheh 09-19-2020 11:35

Re: Map Weapon Touch Pickup
 
Code:
RegisterHam(Ham_Use, "game_player_equip", "fw_use_pequip") public fw_use_pequip(ent , caller) {   }

Ynet 09-19-2020 17:27

Re: Map Weapon Touch Pickup
 
Quote:

Originally Posted by Natsheh (Post 2718195)
Code:
RegisterHam(Ham_Use, "game_player_equip", "fw_use_pequip") public fw_use_pequip(ent , caller) {   }

so i tried what you said it hooks onto the player perfectly and thanks for that but unfortnately when i try the code below it strips the player ( something i don't want to happen )
i can make it simple by silent killing him but i would rather deal with it more professionaly and block it off completely,

any help would be much apprecieted ^^

PHP Code:

public fw_use_pequip(ent caller)
{
    
    if(
get_user_team(caller) != 2)
    return 
HAM_SUPERCEDE
 




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

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