Raised This Month: $51 Target: $400
 12% 

Entity Teleport


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
PawNod
Member
Join Date: Jun 2019
Location: Turkey
Old 07-02-2019 , 07:36   Entity Teleport
Reply With Quote #1

I get origins with const but ı can't teleport it. I want to teleport this origins.
PHP Code:
#include <amxmisc>  
#include <fakemeta>  
#include <engine>  
#include <hamsandwich> 
#include <xs>   

#define PLUGIN "NPC - Non Playar Character - Oyuncu Olmayan Karakter" 
#define VERSION "1.0"  
#define AUTHOR "peNgueN"  

new boolg_NpcOldu512 ];   
new const 
NpcClass[] = "entity_npc";  

new const 
g_NpcIdleAnimations[] = { 1345}; 
new const 
Float:Koordinatlar[][] = {
    {
2298.0,-1099.0,36.0},
    {
2227.0,-891.0,36.0},
    {
2139.0,-723.0,36.0},
    {
2087.0,-1006.0,36.0},
    {
1936.0,-972.0,36.0},
    {
1803.0,-916.0,36.0},
    {
1580.0,-897.0,36.0},
    {
1357.0,-994.0,36.0},
    {
1317.0,-632.0,36.0},
    {
1085.0,-631.0,36.0},
    {
1502.0,-632.0,36.0},
    {
1262.0,-402.0,36.0},
    {
1261.0,-185.0,36.0},
    {
1214.0,-552.0,36.0},
    {
2074.0,-362.0,36.0},
    {
1961.0,-175.0,36.0},
    {
1842.0,-63.0,36.0},
    {
1666.0,-130.0,36.0},
    {
1441.0,-123.0,36.0},
    {
2116.0,-199.0,36.0},
    {
2219.0,-102.0,36.0},
    {
1015.0,-400.0,36.0},
    {
826.0,-526.0,36.0},
    {
584.0,-592.0,36.0},
    {
364.0,-581.0,36.0},
    {
369.0,-871.0,36.0}
}
new const 
g_NpcModel[] = "models/hostageC.mdl"

new 
NpcSayisi;  
new 
exp_spr_id
new El_Puani[33],G_Toplam_P[33],K_Eli[33]

public 
plugin_init()   {  
    
register_pluginPLUGINVERSIONAUTHOR ); 
    
    
register_clcmd"say /npc""NpcMenu" ); 
    
register_clcmd"say_team /npc""NpcMenu" ); 
    
    
RegisterHamHam_Think"info_target""fw_NpcThink" );  
    
// RegisterHam( Ham_Touch, "info_target", "fw_NpcTouch" )
    
register_forward(FM_CmdStart,"fm_cmdstart");  
    
register_logevent("Event_RoundStart"2"1=Round_Start")
}
public 
Event_RoundStart() {
}
public 
client_putinserver(idset_task(1.0,"hudla",id,_,_,"b");
public 
plugin_precache( )  {  
    
precache_modelg_NpcModel );
    
exp_spr_id precache_model("sprites/zerogxplode.spr"
    

public 
hudla(id) {
    if(
is_user_connected(id)) {
        
set_hudmessage(255,00, -1.00.020.15.00.15.0)
        
show_hudmessage(id"|| El Puanin [%i] ||^n|| Toplam Puanin[%i] ||^n|| Kazandigin Toplam El [%i] || ",El_Puani[id],G_Toplam_P[id],K_Eli[id])
        
    }
}
public 
fm_cmdstart(iduc_handleseed) {
    if(!
is_user_alive(id)) return
    
    new 
buttons get_uc(uc_handle,UC_Buttons)
    
    if(
buttons IN_USE){
        
        new 
targetbody
        get_user_aiming
(idtargetbody30)
        static 
ClassName[32]
        
pev(targetpev_classnameClassNamecharsmax(ClassName))
        if (
equal(ClassName"entity_npc"))  {
            
El_Puani[id]++
            
G_Toplam_P[id]++
            
bomb_explode(target)
            
NpcOluyuKaldir(target)
        }
    }
}
public 
bomb_explode(target)  { 
    static 
Float:Origin[3
    
pev(targetpev_originOrigin
     
    
message_begin(MSG_BROADCAST ,SVC_TEMPENTITY
    
write_byte(TE_EXPLOSION)  
    
engfunc(EngFunc_WriteCoordOrigin[0]) 
    
engfunc(EngFunc_WriteCoordOrigin[1]) 
    
engfunc(EngFunc_WriteCoordOrigin[2]) 
    
write_short(exp_spr_id)    // sprite index 
    
write_byte(20)    // scale in 0.1's 
    
write_byte(30)    // framerate 
    
write_byte(0)    // flags 
    
message_end()     

public 
NpcMenuid )  
{  
    new 
iMenu64 ];  
    
formatexiMenucharsmaxiMenu ), "NPC - Oyuncu Olmayan Karakter" ); 
    new 
menu menu_createiMenu"NpcMenu_go" ); 
    
    
formatexiMenucharsmaxiMenu ), "\wNPC Olustur \y( Aim ile yer belirleyin )" ); 
    
menu_additemmenuiMenu"1" ); 
    
formatexiMenucharsmaxiMenu ), "\wNPC Kaldir \y( Aim ile secin )" ); 
    
menu_additemmenuiMenu"2" ); 
    
formatexiMenucharsmaxiMenu ), "\wButun NPC'leri Kaldir^n \y  %d NPC Mevcut"NpcSayisi ); 
    
menu_additemmenuiMenu"3" ); 
    
    
menu_setpropmenuMPROP_EXITMEXIT_ALL); 
    
menu_setpropmenuMPROP_EXITNAME"\rCIKIS" ); 
    
    
menu_display(idmenu);  
    return 
PLUGIN_HANDLED;  
}  

public 
NpcMenu_goidmenuitem 
{  
    
    if( 
item == MENU_EXIT )  
    {  
        
menu_destroymenu );  
        return 
PLUGIN_HANDLED;  
    }  
    
    new 
info], szName64 ];  
    new 
accesscallback;  
    
    
menu_item_getinfomenuitemaccessinfocharsmaxinfo ), szNamecharsmaxszName ), callback ); 
    
    new 
key str_to_numinfo );  
    
    switch( 
key ) {  
        case 
1:  {  
            if( !
is_user_aliveid ) ) return PLUGIN_HANDLED
            
            
            
NpcOlusturid );  
        }  
        case 
2:  
        {  
            if( !
is_user_aliveid ) ) return PLUGIN_HANDLED
            
            new 
iEntVucutNPC64 ]; 
            
get_user_aimingidiEntVucut ); 
            
            if ( 
is_valid_entiEnt ) )  
            {  
                
entity_get_stringiEntEV_SZ_classnameNPCcharsmaxNPC ) ); 
                
                if ( 
equalNPCNpcClass ) )  
                {  
                    
remove_entityiEnt ); 
                    
NpcSayisi--;  
                    
client_printidprint_chat"[NPC] Bir NPC Kaldirildi." );  
                }  
                
            }  
        }  
        case 
3:  
        {  
            
remove_entity_nameNpcClass ); 
            
NpcSayisi 0;  
            
client_printidprint_chat"[NPC] Butun NPC'ler Kaldirildi." ); 
        }  
    }  
    
    
    
menu_destroy(menu);  
    return 
PLUGIN_HANDLED;  

public 
fw_NpcTouchiEntid )    {  
    if( !
is_user_aliveid ) )  
        return 
HAM_SUPERCEDE;  
    
    new 
buttons get_uc(id,UC_Buttons)
    if(
buttons IN_USE) {
        
NpcOluyuKaldir(iEnt
    }
    return 
HAM_IGNORED;  
}  
public 
NpcOluyuKaldirNpc )  {
    
    if(
is_valid_ent(Npc)){      
        
remove_entity(Npc);
    }
}  
public 
fw_NpcThinkiEnt ) {  
    if( !
is_valid_entiEnt ) )  
        return 
HAM_SUPERCEDE;  
    
    new 
NPC64 ];  
    
entity_get_stringiEntEV_SZ_classnameNPCcharsmaxNPC ) ); 
    
    
    if( !
equaliNPCNpcClass ) )  
        return 
HAM_SUPERCEDE;  
    
    if( 
g_NpcOlduiEnt ] )  
        return 
HAM_SUPERCEDE;  
        
    
Util_PlayAnimation(iEntg_NpcIdleAnimationsrandomsizeof g_NpcIdleAnimations ) ] ); 
    
    
entity_set_floatiEntEV_FL_nextthinkget_gametime() + 5.0 ); 
    return 
HAM_IGNORED;  
}  
stock Util_PlayAnimation(indexsequenceFloatframerate 1.0) {
    if (!
is_valid_ent(index))
        return 
    
entity_set_float(indexEV_FL_animtimeget_gametime()); 
    
entity_set_float(indexEV_FL_framerate,  framerate); 
    
entity_set_float(indexEV_FL_frame0.0); 
    
entity_set_int(indexEV_INT_sequencesequence); 
    
}    

stock get_user_hitpoint(idFloat:hOrigin[3]) { 
    if ( ! 
is_user_aliveid ))  
        return 
0;  
    
    new 
Float:fOrigin[3], Float:fvAngle[3], Float:fvOffset[3], Float:fvOrigin[3], Float:feOrigin[3]; 
    new 
Float:fTemp[3];  
    
    
pev(idpev_originfOrigin);  
    
pev(idpev_v_anglefvAngle);  
    
pev(idpev_view_ofsfvOffset); 
    
    
xs_vec_add(fOriginfvOffsetfvOrigin); 
    
    
engfunc(EngFunc_AngleVectorsfvAnglefeOriginfTempfTemp); 
    
    
xs_vec_mul_scalar(feOrigin9999.9feOrigin); 
    
xs_vec_add(fvOriginfeOriginfeOrigin); 
    
    
engfunc(EngFunc_TraceLinefvOriginfeOrigin0id); 
    
global_get(glb_trace_endposhOrigin); 
    return 
1;  
}   
public 
NpcOlusturid )  {  
    new  
Float:Origin], FloatAngle]; 
    
    new 
iEnt create_entity"info_target" ); 
    
    
entity_set_stringiEntEV_SZ_classnameNpcClass ); 
    
    
//get_user_hitpoint( id, Origin ); 
    
    
entity_get_vector(idEV_VEC_anglesAngle ); 
    
Angle] = 0.0;  
    
    
entity_set_vectoriEntEV_VEC_anglesAngle ); 
    
    
entity_set_modeliEntg_NpcModel ); 
    
entity_set_int(iEntEV_INT_movetypeMOVETYPE_PUSHSTEP ); 
    
    
entity_set_int(iEntEV_INT_solidSOLID_BBOX ); 
    
    new 
Floatmins[3] = {-12.0, -12.00.0 }; 
    new 
Floatmaxs[3] = { 12.012.075.0 }; 
    
    
entity_set_size(iEntminsmaxs); 
    
    
entity_set_byteiEntEV_BYTE_controller1125 ); 
    
    
    
drop_to_flooriEnt );  
    
    
g_NpcOlduiEnt ] = false;  
    
NpcSayisi++;  
    
// NOT WORKİNG 
    
for(new isizeof Koordinatlar++) {
    
Origin[0] = Koordinatlar[i][0]
    
Origin[1] =  Koordinatlar[i][1]
    
Origin[2] =  Koordinatlar[i][2]
    
entity_set_origin(iEnt,Origin)
    
NpcOlustur(id
    }
    
    
entity_set_floatiEntEV_FL_nextthinkget_gametime() + 1.0 );     


Last edited by PawNod; 07-02-2019 at 07:39.
PawNod is offline
PawNod
Member
Join Date: Jun 2019
Location: Turkey
Old 07-03-2019 , 03:59   Re: Entity Teleport
Reply With Quote #2

Update
PawNod is offline
Mordekay
Squirrel of Fortune
Join Date: Apr 2006
Location: Germany
Old 07-03-2019 , 08:34   Re: Entity Teleport
Reply With Quote #3

Last edited: 25 hours ago, so where is the update?
You bumped your thread for 5 threads higher on the first page!
This is a perfect example on how to piss of users that want to help but refuse to because some users cannot wait a single day for a reply.
__________________

Mordekay is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 07-03-2019 , 09:11   Re: Entity Teleport
Reply With Quote #4

His whole plugin don't make sense he should try to reconfigure what he is doing.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
thEsp
BANNED
Join Date: Aug 2017
Old 07-03-2019 , 09:28   Re: Entity Teleport
Reply With Quote #5

I get origins with const
Ohhh no you don't!
thEsp is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 07-03-2019 , 09:33   Re: Entity Teleport
Reply With Quote #6

This doesn't make sense
PHP Code:
    // NOT WORKİNG  
    
for(new isizeof Koordinatlar++) { 
    
Origin[0] = Koordinatlar[i][0
    
Origin[1] =  Koordinatlar[i][1
    
Origin[2] =  Koordinatlar[i][2
    
entity_set_origin(iEnt,Origin
    
NpcOlustur(id)  
    } 
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
PawNod
Member
Join Date: Jun 2019
Location: Turkey
Old 07-03-2019 , 12:39   Re: Entity Teleport
Reply With Quote #7

@Natsheh I don't do it so I share this topic do you repair it
@theEsp what can ı do else
PawNod is offline
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 01:31.


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