AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Create model entity on screen. (https://forums.alliedmods.net/showthread.php?t=167969)

.Dare Devil. 09-22-2011 13:20

Create model entity on screen.
 
Hi.

I want to make something new.
I need help to put one model in screen,
i can do this only for now :

Create model entity, give him player origin ( edit +x,+y,+z )
and update model every 0.1 sec.

Put, i want to do this model like this player who see it on screen, nobody else can see this.

Like claws models, but claws model moving if you walk but i want this model stay on player screen and do not move.

I dont know how to do it, i mean
i know i need to use "FM_AddToFullPack"

its strange...
I have looked it but still i cant do nothing with this.

Thanks for reading.

jimaway 09-22-2011 18:36

Re: Create model entity on screen.
 
Quote:

FM_AddToFullPack(entState, e, ent, host, iHostFlags, iPlayer, pSet)

AddToFullPack
Return 1 if the entity state has been filled in for the ent and the entity will be propagated to the client,
0 otherwise state is the server maintained copy of the state info that is transmitted to the client.
A MOD could alter values copied into state to send the "host" a different look for a particular entity update, etc.
e and ent are the entity that is being added to the update, if 1 is returned.
Host is the player's edict of the player whom we are sending the update to.
Player is 1 if the ent/e is a player and 0 otherwise.
pSet is either the PAS or PVS that we previous set up.
We can use it to ask the engine to filter the entity against the PAS or PVS.
We could also use the pas/pvs that we set in SetupVisibility, if we wanted to.
Caching the value is valid in that case, but still only for the current frame.

.Dare Devil. 09-23-2011 07:37

Re: Create model entity on screen.
 
hard, just cant do it.
example please! xD

jimaway 09-23-2011 09:33

Re: Create model entity on screen.
 
PHP Code:

#include <amxmodx>
#include <fakemeta>

new g_iEnt //assign the entity id here
new g_iPlayer //player id who should be able to see that entity

public plugin_init() {
    
register_forward(FM_AddToFullPack,"fwd_AddToFullPack"1)
}
public 
fwd_AddToFullPack(entStateeenthostiHostFlagsiPlayerpSet) {
    if (
iPlayer)
        return 
FMRES_IGNORED //ent is a player, ignore this forward
    
if (ent == g_iEnt && host != g_iPlayer) {
        
// host isnt g_iPlayer, he shouldnt see that entity
        
set_es(entStateES_RenderModekRenderTransAlpha)
        
set_es(entStateES_RenderAmt0)
    }
    return 
FMRES_IGNORED


try this for an example, ive never used addtofullpack and i didnt test it, so it might not work :D

dias 09-24-2011 04:43

Re: Create model entity on screen.
 
@jimaway:
- Can you help me to make a NPC that can repeat 100% action of the real player ?. I try and still can't get it repeat 100% action of the real player
I need it. help me

@.Dare Devil.:
- Want to do Confuse bomb ? :)


All times are GMT -4. The time now is 19:39.

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