Raised This Month: $ Target: $400
 0% 

[HELP] get_distance_f


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
TheArmagedon
Senior Member
Join Date: Sep 2010
Location: Unknown Source
Old 09-20-2011 , 21:43   [HELP] get_distance_f
Reply With Quote #1

I have a problem with get_distance_f
When i type in chat "lala (registered in clcmd)" automatically creates a entity and shows for me the distance between me and ent...
But it did not work... In first time it works fine but when i type again, the entity creates normally but it shows "[", "u", "(" of distance...
Whats wrong with the code?

PHP Code:
#include <amxmodx>
#include <engine>
#include <fakemeta>

new const gModel[ ] = "models/teste.mdl"

public plugin_init()
    
register_clcmd("say lala""LALAc")
    
public 
plugin_precache()
    
precache_modelgModel )
    
public 
LALAc(id)
{
    new 
ent create_entity"info_target" );
    
    if( !
pev_valident ) )
    {
        return;
    }
    
    new 
Float:flPlayerOrigin];
    new 
Float:OrigENT];
    
pevidpev_originflPlayerOrigin );
    
peventpev_originOrigENT );
        
    
flPlayerOrigin] += 4.0;
    
    
engfuncEngFunc_SetOriginentflPlayerOrigin );
    
    
engfuncEngFunc_SetModelentgModel );
        
    
set_peventpev_solidSOLID_SLIDEBOX );
    
set_peventpev_movetypeMOVETYPE_NONE );
        
    
set_peventpev_framerate1.0 );
    
set_peventpev_sequence"spin" );
    
engfuncEngFunc_SetSizeentFloat:{ -10.0, -10.0, -10.0 }, Float:{ 10.010.010.0 } );
    
engfuncEngFunc_DropToFloorent );
    
set_peventpev_nextthinkget_gametime( ) + 1.0 );
    
    new 
Float:distancia
    distancia 
get_distance_fflPlayerOriginOrigENT )
    
    
client_print(idprint_chat"Distance between me and ent is: %s"distancia)
    

TheArmagedon is offline
 



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:44.


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