AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Barrier & find_ent_by_model (https://forums.alliedmods.net/showthread.php?t=11921)

LynX 03-31-2005 10:35

Barrier & find_ent_by_model
 
1 ) I'm looking for a way that I would make that other players can not close to player on which this function is in progress. So, if an opponent closes to player which has this barrier on - it tosses him away, so he cannot get to player close. So, basically I'm looking for code that will swat opponent back 12 meters if he closed on 3 metres to player. I know this is possible, because I've seen it on server and it worked just beautfull. I think you need to do something with vectors or somthing - but can you show me as I never used vectors.

2) find_ent_by_model function works for finding entity by model, right? But, I just want to find entity by model, not by classname because I don't know classname.

I made it like this:

Code:
SpriteIndex[id] = find_ent_by_model(id, _ , "banner.spr")

But it gave me erros and didn't wanted to compile.
I created new array SpriteIndex[33], so that's not the problem. Problem is that it does not accept "_" , so I don't know what to do. I just want to find by model, not by model AND classname. Any suggestions?

Thanks.

Twilight Suzuka 03-31-2005 12:45

Well no duh it wont accept "_", its not a valid variable.

find_ent_by_model ( StartEntity, Classname[], Model[] )

You have to specify a classname. You cannot NOT specify one. You might be able to put in "" or "*", but why the hell did you think _ would work.

LynX 03-31-2005 13:32

Well, it works all the time when I don't specify something in, let's say set_task.
But I'll try it now. Thnx Mel ^^ .

Any idea on push-away ( barrier ) thing?


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

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