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

Entity Teleport missing something ..


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Zaidbt
Senior Member
Join Date: Jun 2014
Location: Morroco
Old 04-02-2015 , 06:02   Entity Teleport missing something ..
Reply With Quote #1

Hi , Again^5 ( i guess )

PHP Code:
public cmd_portal(id)   
{   
    if(
Hasxxx[id]) 
    {  
        new 
enOrigin[3]   
        
get_user_origin(idenOrigin)   
        
enOrigin[2] = enOrigin[2] + 20   
        client_print
(0print_chat"%d started creating portal..."id)   
        
set_task(1.0"create_portal"idenOrigin3
    }
    else
    {
        
client_print(idprint_center"You're not Sasuke , you can't use portals ..")
        return 
PLUGIN_HANDLED
    
}
    return 
PLUGIN_HANDLED
}
public 
cmd_portal2(id)   
{   
    if(
Hasxxx[id])  
    { 
        new 
exOrigin[3]   
        
        
get_user_origin(idexOrigin)   
        
        
client_print(0print_chat"%d started creating portal..."id)   
        
        
set_task(1.0"create_portal2"idexOrigin3
    } 
    else
    {
        
client_print(idprint_center"You're not Sasuke , you can't use portals ..")
        return 
PLUGIN_HANDLED
    
}
    }   
public 
portal_touch(entid)   
{      
    if(
Hasxxx[id]) 
        return 
PLUGIN_CONTINUE 
    
    
new Owner entity_get_edict(ent,EV_ENT_owner)   
    
    if(
Owner == id)   
    {   
        if(!Exit)   
        {   
            
client_print(idprint_center"Create A Exit Portal First")   
        }   
        else   
        {   
            
            
set_user_origin(idiTeleportOrigin)   
            
client_print(id,print_center,"You have been teleported")   
            
client_print(idprint_chat"Teleported..")   
            
set_user_health(idget_user_healthid ) + 1);    
        }   
    }   
    else   
    {   
        
client_print(idprint_center"Use your own portals")   
        return 
PLUGIN_HANDLED
    
}   
    
    
    
}

public 
create_portal(enOrigin[3], id)   
{   
    new 
Float:fOrigin[3]   
    new 
ent create_entity("env_sprite")   
    
    
remove_entity_name("portal_entrance")   
    
    
IVecFVec(enOriginfOrigin)   
    
    
    
entity_set_string(entEV_SZ_classname"portal_entrance")   
    
entity_set_model(ent"sprites/e-tele1.spr")   
    
entity_set_int(entEV_INT_spawnflagsSF_SPRITE_STARTON)   
    
entity_set_float(entEV_FL_framerate30.0)   
    
    
DispatchSpawn(ent)   
    
    
entity_set_origin(entfOrigin)   
    
entity_set_size(entFloat:{-25.0, -25.0, -25.0}, Float:{25.025.025.0})   
    
entity_set_int(entEV_INT_solidSOLID_TRIGGER)   
    
entity_set_int(entEV_INT_movetypeMOVETYPE_FLY)   
    
entity_set_int(entEV_INT_rendermodekRenderTransAdd)   
    
entity_set_float(entEV_FL_renderamt255.0)   
    
entity_set_float(entEV_FL_scale1.0)   
    
entity_set_edict(ent,EV_ENT_ownerid)   
    
    
client_print(0print_chat"%d created portal (%d)"ident)   
}   
    
    
public 
create_portal2(exOrigin[3], id)   
{   
    new 
Float:fOrigin[3]   
    
    
remove_entity_name"portal_exit" )   
    
    new 
ent create_entity("env_sprite")   
    
    
IVecFVec(exOriginfOrigin)   
    
    
    
entity_set_string(entEV_SZ_classname"portal_exit")   
    
entity_set_model(ent"sprites/e-tele1.spr")   
    
entity_set_int(entEV_INT_spawnflagsSF_SPRITE_STARTON)   
    
entity_set_float(entEV_FL_framerate30.0)   
    
    
DispatchSpawn(ent)   
    
    
entity_set_origin(entfOrigin)   
    
entity_set_size(entFloat:{-25.0, -25.0, -25.0}, Float:{25.025.025.0})   
    
entity_set_int(entEV_INT_solidSOLID_TRIGGER)   
    
entity_set_int(entEV_INT_movetypeMOVETYPE_FLY)   
    
entity_set_int(entEV_INT_rendermodekRenderTransAdd)   
    
entity_set_float(entEV_FL_renderamt255.0)   
    
entity_set_float(entEV_FL_scale1.0)   
    
entity_set_edict(ent,EV_ENT_ownerid)   
    
    
client_print(0print_chat"%d created portal (%d)"ident)   
    Exit = 
true   
    
    entity_get_vector
(entEV_VEC_originfTeleportOrigin)   
    
    
FVecIVec(fTeleportOriginiTeleportOrigin)   
    

Description : It's a plugin that let you create 2 portals that you can teleport between them , Using portal_entrance (console) To create an Entrance and Portal_exit To create an Exit .
Thén , when you walk into the entrance , you get teleported to the exit ...
Probleme : when i'm on my local server , portals are running correctly . But, when i try this on my server ( internet ) Portals are created , but they won't teleport ..
Also , When I Create a portal , then another player create a portal , mine diseaper .

Could any one help pls ? ^_^
__________________
http://steamcommunity.com/profiles/76561198044821965
=========Working On Naruto Mod========
Zaidbt is offline
Obada
Senior Member
Join Date: Dec 2014
Location: Abu Dhabi
Old 04-02-2015 , 07:48   Re: Entity Teleport missing something ..
Reply With Quote #2

For the part where you say "When another player has created a portal, yours disappear", I'd say you'll need to use for loop for that.

Although I'm not pretty sure, since I'm a beginner.
Obada is offline
mottzi
Veteran Member
Join Date: May 2010
Location: Switzerland
Old 04-02-2015 , 11:52   Re: Entity Teleport missing something ..
Reply With Quote #3

Let's start with you posting the full code.
mottzi is offline
Send a message via MSN to mottzi
Zaidbt
Senior Member
Join Date: Jun 2014
Location: Morroco
Old 04-02-2015 , 12:50   Re: Entity Teleport missing something ..
Reply With Quote #4

PHP Code:
new bool:HasSpeed[33]   
new 
bool:Exit   
new 
bool:Hasxxx[33]
new 
bool:Hasx[33]   
new 
FloatfTeleportOrigin[3]   
new 
iTeleportOrigin[3
PHP Code:
public plugin_precache()   
{   
precache_model("sprites/narutomod/e-tele1.spr"

PHP Code:
public client_putinserver(id
{  
    
HasSpeed[id] = true   
    Hasxxx
[id] = false
    Hasx
[id] = false

PHP Code:
case 4:     
        {     
            
client_printidprint_chat"You have selected Sasuke" );
            
client_printidprint_chat"Use Bind X portal_entrance " ); 
            
client_printidprint_chat"Use Bind X portal_exit " ); 
            
set_user_health(idget_user_healthid ) + 450);
            
give_item(id"weapon_hegrenade"
            
give_item(id"weapon_smokegrenade"
            
cs_set_user_bpammo(idCSW_HEGRENADE5
            
cs_set_user_bpammo(idCSW_SMOKEGRENADE5)
            
set_user_maxspeed(id1000.0); 
            
cs_set_user_model(id"Sasuke")
            
set_user_noclip(id0)
            
set_user_rendering(idkRenderFxGlowShell600138kRenderGlow25);  
            
Hasxxx[id] = true
            Hasx
[id] = false
        

PHP Code:
public cmd_portal(id)   
{   
    if(
Hasxxx[id]) 
    {  
        new 
enOrigin[3]   
        
get_user_origin(idenOrigin)   
        
enOrigin[2] = enOrigin[2] + 20   
        client_print
(0print_chat"%d started creating portal..."id)   
        
set_task(1.0"create_portal"idenOrigin3
    }
    else
    {
        
client_print(idprint_center"You're not Sasuke , you can't use portals ..")
        return 
PLUGIN_HANDLED
    
}
    return 
PLUGIN_HANDLED
}
public 
cmd_portal2(id)   
{   
    if(
Hasxxx[id])  
    { 
        new 
exOrigin[3]   
        
        
get_user_origin(idexOrigin)   
        
        
client_print(0print_chat"%d started creating portal..."id)   
        
        
set_task(1.0"create_portal2"idexOrigin3
    } 
    else
    {
        
client_print(idprint_center"You're not Sasuke , you can't use portals ..")
        return 
PLUGIN_HANDLED
    
}
    }   
public 
portal_touch(entid)   
{      
    if(
Hasxxx[id]) 
        return 
PLUGIN_CONTINUE 
    
    
new Owner entity_get_edict(ent,EV_ENT_owner)   
    
    if(
Owner == id)   
    {   
        if(!Exit)   
        {   
            
client_print(idprint_center"Create A Exit Portal First")   
        }   
        else   
        {   
            
            
set_user_origin(idiTeleportOrigin)   
            
client_print(id,print_center,"You have been teleported")   
            
client_print(idprint_chat"Teleported..")   
            
set_user_health(idget_user_healthid ) + 1);    
        }   
    }   
    else   
    {   
        
client_print(idprint_center"Use your own portals")   
        return 
PLUGIN_HANDLED
    
}   
    
    
    
}

public 
create_portal(enOrigin[3], id)   
{   
    new 
Float:fOrigin[3]   
    new 
ent create_entity("env_sprite")   
    
    
remove_entity_name("portal_entrance")   
    
    
IVecFVec(enOriginfOrigin)   
    
    
    
entity_set_string(entEV_SZ_classname"portal_entrance")   
    
entity_set_model(ent"sprites/narutomod/e-tele1.spr")   
    
entity_set_int(entEV_INT_spawnflagsSF_SPRITE_STARTON)   
    
entity_set_float(entEV_FL_framerate30.0)   
    
    
DispatchSpawn(ent)   
    
    
entity_set_origin(entfOrigin)   
    
entity_set_size(entFloat:{-25.0, -25.0, -25.0}, Float:{25.025.025.0})   
    
entity_set_int(entEV_INT_solidSOLID_TRIGGER)   
    
entity_set_int(entEV_INT_movetypeMOVETYPE_FLY)   
    
entity_set_int(entEV_INT_rendermodekRenderTransAdd)   
    
entity_set_float(entEV_FL_renderamt255.0)   
    
entity_set_float(entEV_FL_scale1.0)   
    
entity_set_edict(ent,EV_ENT_ownerid)   
    
    
client_print(0print_chat"%d created portal (%d)"ident)   
}   
    
    
public 
create_portal2(exOrigin[3], id)   
{   
    new 
Float:fOrigin[3]   
    
    
remove_entity_name"portal_exit" )   
    
    new 
ent create_entity("env_sprite")   
    
    
IVecFVec(exOriginfOrigin)   
    
    
    
entity_set_string(entEV_SZ_classname"portal_exit")   
    
entity_set_model(ent"sprites/narutomod/e-tele1.spr")   
    
entity_set_int(entEV_INT_spawnflagsSF_SPRITE_STARTON)   
    
entity_set_float(entEV_FL_framerate30.0)   
    
    
DispatchSpawn(ent)   
    
    
entity_set_origin(entfOrigin)   
    
entity_set_size(entFloat:{-25.0, -25.0, -25.0}, Float:{25.025.025.0})   
    
entity_set_int(entEV_INT_solidSOLID_TRIGGER)   
    
entity_set_int(entEV_INT_movetypeMOVETYPE_FLY)   
    
entity_set_int(entEV_INT_rendermodekRenderTransAdd)   
    
entity_set_float(entEV_FL_renderamt255.0)   
    
entity_set_float(entEV_FL_scale1.0)   
    
entity_set_edict(ent,EV_ENT_ownerid)   
    
    
client_print(0print_chat"%d created portal (%d)"ident)   
    Exit = 
true   
    
    entity_get_vector
(entEV_VEC_originfTeleportOrigin)   
    
    
FVecIVec(fTeleportOriginiTeleportOrigin)   
    

__________________
http://steamcommunity.com/profiles/76561198044821965
=========Working On Naruto Mod========
Zaidbt 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 10:22.


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