Raised This Month: $ Target: $400
 0% 

Problem with pev_view_ofs


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 02-10-2010 , 03:11   Problem with pev_view_ofs
Reply With Quote #1

Hi,

i wanted to catch the origins of users view offset(Aim origins) to spawn my sprite, but like ever i have a problem

the offset/origins are not correct.

PHP Code:
public ClientCommand_CreateMagic ( const Player, const Level, const Cid )
{
    if ( !
cmd_accessPlayerLevelCid) )
    {
        return 
PLUGIN_HANDLED;
    }
    
    new 
Float:Origin[3];
    new 
Entity;
    
    
pev(Player,pev_v_angle,Origin)
    
    if ( ( 
Entity create_entity"info_target" ) ) )
    {
        
set_pevEntitypev_classnamegMagicBallClassname );
        
        
        
engfuncEngFunc_SetSize  EntityFloat:{ -311.0, -1.0, -1.0 }, Float:{ 311.01.01.0 } );
        
engfuncEngFunc_SetOriginEntityOrigin );
        
        
set_pevEntitypev_effectsEF_BRIGHTFIELD );
        
set_pevEntitypev_solidSOLID_BBOX );
        
set_pevEntitypev_movetypeMOVETYPE_TOSS );
        
set_pevEntitypev_ownerPlayer );
        
set_pevEntitypev_nextthinkget_gametime() + 0.1 );
    }
    
    return 
PLUGIN_HANDLED_MAIN;

&& when i use the command to spawn the ball, i got crashes no error, nothing in log. my game will be freezed.
Attached Thumbnails
Click image for larger version

Name:	1.jpg
Views:	727
Size:	97.4 KB
ID:	59442  
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 02-10-2010 , 06:05   Re: Problem with pev_view_ofs
Reply With Quote #2

pev(Player,pev_v_angle,Origin)
engfunc( EngFunc_SetOrigin, Entity, Origin );


You think really that pev_v_angle is an origin ?
__________________
Arkshine is offline
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 02-10-2010 , 06:12   Re: Problem with pev_view_ofs
Reply With Quote #3

ty & Nope.

you know why i cant spawn more sprites ? how i said, i got crashes when i spawn more that 1 sprite
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 02-10-2010 , 06:17   Re: Problem with pev_view_ofs
Reply With Quote #4

You don't show enough code.
__________________
Arkshine is offline
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 02-10-2010 , 06:23   Re: Problem with pev_view_ofs
Reply With Quote #5

Silly coded...

PHP Code:

new const gwatterBallClassname[] = "watterball";
new 
gLaserSprite;
#define write_coord_f(%0)  ( engfunc( EngFunc_WriteCoord, %0 ) )

public ClientCommand_Createwatter ( const Player, const Level, const Cid )
{
    if ( !
cmd_accessPlayerLevelCid) )
    {
        return 
PLUGIN_HANDLED;
    }
    
    new 
Float:Origin[3];
    new 
Entity;
    
    
pevPlayerpev_originOrigin );
    
    if ( ( 
Entity create_entity"info_target" ) ) )
    {
        
set_pevEntitypev_classnamegwatterBallClassname );
        
        
        
engfuncEngFunc_SetSize  EntityFloat:{ -311.0, -1.0, -1.0 }, Float:{ 311.01.01.0 } );
        
engfuncEngFunc_SetOriginEntityOrigin );
        
        
set_pevEntitypev_effectsEF_BRIGHTFIELD );
        
set_pevEntitypev_solidSOLID_BBOX );
        
set_pevEntitypev_movetypeMOVETYPE_TOSS );
        
set_pevEntitypev_ownerPlayer );
        
set_pevEntitypev_nextthinkget_gametime() + 0.1 );
    }
    
    return 
PLUGIN_HANDLED_MAIN;
}
public 
ClientCommand_Killwatter ( const Player, const Level, const Cid )
{
    if ( 
cmd_accessPlayerLevelCid) )
    {
        
remove_entity_namegwatterBallClassname );
        return 
PLUGIN_HANDLED_MAIN;
    }
    
    return 
PLUGIN_HANDLED;
}
public 
CwatterBall_Think ( const Entity )
{
    if ( !
is_valid_entEntity ) )
    {
        return;
    }
    static 
Float:Origin[3];
    static 
Float:TestEnd[3];
    static 
Float:EndPos[3];
    
    
pevEntitypev_originOrigin );
    
    
TestEnd[0] = random_float( -5000.05000.0 );
    
TestEnd[1] = random_float( -5000.05000.0 );
    
TestEnd[2] = random_float0.05000.0 );
    
    
trace_lineEntityOriginTestEndEndPos );
    
    
message_beginMSG_BROADCASTSVC_TEMPENTITY );
    
write_byteTE_BEAMCYLINDER  )
    
write_coord_fOrigin[0] );
    
write_coord_fOrigin[1]  );
    
write_coord_fOrigin[2] + 200.0 );
    
write_coord_fEndPos[0] );
    
write_coord_fEndPos[1] );
    
write_coord_fEndPos[2] );
    
write_shortgLaserSprite );
    
write_byte255 );    //Start frame 0 
    
write_byte255 );    //Frame rate 0
    
write_byte20 );    //Life 10
    
write_byte10);    //Width 20
    
write_byte255);    //noise 300
    
write_byterandom_num(1,255) );    //R
    
write_byterandom_num(1,255)  );    //G
    
write_byterandom_num(1,255)  );    //B
    
write_byte255 );    //brightness 200
    
write_byte);    //Scroll 30
    
message_end();        //End
    
    
    
set_pevEntitypev_nextthinkget_gametime() + 0.25 );

Dont lol @ code please
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
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 07:19.


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