AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Some question about Ham_Touch (https://forums.alliedmods.net/showthread.php?t=184362)

Bilal Pro 05-04-2012 06:54

Some question about Ham_Touch
 
Hello there,


PHP Code:

RegisterHam(Ham_Touch"grenade""fwd_Ham_Touch"); 

My question is, will this check if he touches the grenade?

<VeCo> 05-04-2012 07:26

Re: Some question about Ham_Touch
 
What exactly do you want to do?
If you are asking whether the function will be called when grenade touches something - yes, it will.

Bilal Pro 05-04-2012 07:30

Re: Some question about Ham_Touch
 
I am trying to make a dodgeball mod, for a last request plugin.

So when the grenade touches you in the air you will die

<VeCo> 05-04-2012 07:36

Re: Some question about Ham_Touch
 
Then yes, that will work.
The function should look like this:

PHP Code:

public fwd_Ham_Touch(ent,id//ent is grenade entity index, id is the index of the player
{
        
// Here you can check if id is a valid connected player and if he is in the air (~FL_ONGROUND).
        // If you want to work only for HE Grenades, then you should also add a check for ent's model.



fysiks 05-04-2012 09:49

Re: Some question about Ham_Touch
 
Quote:

Originally Posted by Bilal Pro (Post 1701835)
Hello there,


PHP Code:

RegisterHam(Ham_Touch"grenade""fwd_Ham_Touch"); 

My question is, will this check if he touches the grenade?

You can easily test this and answer for yourself. This is why I said what I said in the other thread.

Bilal Pro 05-04-2012 10:53

Re: Some question about Ham_Touch
 
I was on my phone at my grandmother, how am i able to test it.

And i had some more questions about ham touch.

Xalus 05-04-2012 11:24

Re: Some question about Ham_Touch
 
If you are on ur phone,

how the hell u code oO

Exolent[jNr] 05-04-2012 11:26

Re: Some question about Ham_Touch
 
Use register_touch() because you can specify both classnames of entities that are touching each other.

fysiks 05-05-2012 01:12

Re: Some question about Ham_Touch
 
Quote:

Originally Posted by Bilal Pro (Post 1702000)
I was on my phone at my grandmother, how am i able to test it.

And i had some more questions about ham touch.

Not a good excuse. If you can't test then don't ask until after you've tested.

If you find that it does work then you can ask "Is there a better method than Ham_Touch to do this?" If it doesn't work then you say "I've tried this but it doesn't work, is how would I do it?"


All times are GMT -4. The time now is 00:26.

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