Raised This Month: $ Target: $400
 0% 

Create model entity on screen.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 09-22-2011 , 13:20   Create model entity on screen.
Reply With Quote #1

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.
.Dare Devil. is offline
jimaway
Heeeere's Jimmy!
Join Date: Jan 2009
Location: Estonia
Old 09-22-2011 , 18:36   Re: Create model entity on screen.
Reply With Quote #2

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.
jimaway is offline
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 09-23-2011 , 07:37   Re: Create model entity on screen.
Reply With Quote #3

hard, just cant do it.
example please! xD
.Dare Devil. is offline
jimaway
Heeeere's Jimmy!
Join Date: Jan 2009
Location: Estonia
Old 09-23-2011 , 09:33   Re: Create model entity on screen.
Reply With Quote #4

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
jimaway is offline
dias
BANNED
Join Date: Jul 2009
Location: South Vietnam
Old 09-24-2011 , 04:43   Re: Create model entity on screen.
Reply With Quote #5

@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 ?
dias is offline
Send a message via Yahoo to dias Send a message via Skype™ to dias
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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