AlliedModders

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

Xalus 05-03-2012 15:41

AddFullToPack entity
 
Hello,

Bcs it only works on players,

is it possible to make it work for entities,
so we can make so some players can only see some entities and all.

Exolent[jNr] 05-03-2012 16:02

Re: AddFullToPack entity
 
AddToFullPack is not for players only. You can hide entities from players with it.

Xalus 05-03-2012 16:46

Re: AddFullToPack entity
 
Quote:

Originally Posted by Exolent[jNr] (Post 1701392)
AddToFullPack is not for players only. You can hide entities from players with it.

Hmm lol,
Didn't know that..

I touge with the tests I did it was always Players only,
but thanks for the answer.

I will test out later!

Exolent[jNr] 05-03-2012 17:12

Re: AddFullToPack entity
 
There is a parameter that is passed which says whether it is checking players or other entities.

Code:
public FwdAddToFullPack(es, e, ent, host, hostFlags, player, pSet) {     if(player) {         // ent is a player     } else {         // ent is some other entity     } }

Xalus 05-04-2012 17:39

Re: AddFullToPack entity
 
PHP Code:

public AddToFullPack_BlockeseiEntityiHostiHostFlagsiPlayerpSet ) {
    if( 
pev_valid(iEntity) && !iPlayer && is_user_alive(iHost) && get_user_team(iHost) == ) {
        new 
szClassname[32]
        
pev(iEntitypev_classnameszClassnamecharsmax(szClassname))

        if(
equali(szClassnameBLOCK)) {
            
set_esesES_SolidSOLID_BBOX )
            
//set_pev(e, pev_solid, SOLID_BBOX )
            //set_pev( e, pev_renderamt, get_block_rendering(iEntity) )
        
}
    }


It gets detected, but it doesnt go Solid,
set_pev worked, but bugged for Ts.

ConnorMcLeod 05-04-2012 17:42

Re: AddFullToPack entity
 
Describe exactly what you are trying to do, which mod etc...

Exolent[jNr] 05-04-2012 17:47

Re: AddFullToPack entity
 
I don't think this will completely solve it, but make sure you are hooking it as post.

Then, you need to continue like how semiclip was made:

Code:
#include <amxmodx> #include <fakemeta> #define pev_oldsolid pev_button new const BLOCK[] = "block"; new bool:gRestoreEntities; public plugin_init() {     register_forward(FM_PlayerPreThink, "FwdPlayerPreThink");     register_forward(FM_PlayerPostThink, "FwdPlayerPostThink");         register_forward(FM_AddToFulLPack, "FwdAddToFullPackPost", 1); } public FwdPlayerPreThink(id) {     if(is_user_alive(id) && get_user_team(id) == 2) {         new ent = -1;         while((ent = engfunc(EngFunc_FindEntityByString, ent, "classname", BLOCK))) {             set_pev(ent, pev_oldsolid, pev(ent, pev_solid));             set_pev(ent, pev_solid, SOLID_BBOX);         }                 gRestoreEntities = true;     } } public FwdPlayerPostThink(id) {     if(gRestoreEntities) {         new ent = -1;         while((ent = engfunc(EngFunc_FindEntityByString, ent, "classname", BLOCK))) {             set_pev(ent, pev_solid, pev(ent, pev_oldsolid));         }                 gRestoreEntities = false;     } } public FwdAddToFullPackPost(esHandle, e, ent, host, hostFlags, player, pSet) {     if(!player && pev_valid(ent) && is_user_alive(host) && get_user_team(host) == 2) {         static className[32];         pev(ent, pev_classname, className, charsmax(className));                 if(equal(className, BLOCK)) {             set_es(esHandle, ES_Solid, SOLID_BBOX);         }     } }

ConnorMcLeod 05-04-2012 19:07

Re: AddFullToPack entity
 
That won't help i think, but something can be made for sure with groupinfo.

Xalus 05-05-2012 04:28

Re: AddFullToPack entity
 
Quote:

Originally Posted by ConnorMcLeod (Post 1702271)
That won't help i think, but something can be made for sure with groupinfo.

Not really, bcs I still want them to see the blocks ;)


EDIT: Exolent
register_forward(FM_AddToFulLPack, "FwdAddToFulLPackPost", 1);
->
register_forward(FM_AddToFulLPack, "FwdAddToFullPackPost", 1);


But I will test it, thx!

EDIT: Exolent
Thx, it works almost perfect :p


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

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