AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Hostage Creating Help!! (https://forums.alliedmods.net/showthread.php?t=272957)

asur 10-10-2015 03:28

Hostage Creating Help!!
 
1 Attachment(s)
I dont know y the hostage is spawned above the ground not on the ground.........it is spawning at the height of my character's neck.....

I have calculated the origins from teleport plugin .....
Please help!!!!
PHP Code:

#include <amxmodx>
#include <engine>

public plugin_init() {
    
register_plugin("Hostage Spawner""1.0""NONE")
    
register_concmd("hostage""host_spawn")
}

public 
plugin_precache() {
    
precache_model("models/hostage.mdl")
    
precache_sound("hostage/hos1.wav")
}

public 
host_spawn(id) {
    new 
Float:origin[3] = { -2687.0574.0, -1962.0 }
    new 
host create_entity("hostage_entity")
    if( 
is_valid_enthost ) )
    {
        
entity_set_float(host,EV_FL_takedamage,1.0)
        
entity_set_float(host,EV_FL_health,100.0)
        
        
entity_set_string(host,EV_SZ_classname,"hostage_entity");
        
entity_set_model(host,"models/hostage.mdl");
        
entity_set_int(host,EV_INT_solid2)
        
        
/*entity_set_byte(host,EV_BYTE_controller1,125);
        entity_set_byte(host,EV_BYTE_controller2,125);
        entity_set_byte(host,EV_BYTE_controller3,125);
        entity_set_byte(host,EV_BYTE_controller4,125);
        */
        
new Float:maxs[3] = {16.0,16.0,36.0}
        new 
Float:mins[3] = {-16.0,-16.0,-36.0}
        
entity_set_size(host,mins,maxs)
        
        
/*entity_set_float(host,EV_FL_animtime,2.0)
        entity_set_float(host,EV_FL_framerate,1.0)
        entity_set_int(host,EV_INT_sequence,0);
        */
        
entity_set_float(host,EV_FL_nextthink,halflife_time() + 0.01)
        
        
entity_set_origin(host,origin)
        
        
//drop_to_floor(host)
    
        
return 1
    
}
    
    return 
0
       



HamletEagle 10-10-2015 07:40

Re: Hostage Creating Help!!
 
What do you want to do ? Create a true hostage or just some dummy entity that looks like one ? It should be created with a command ? Where should it be created ? At the aim of the player, where the player is on at T spawn ?

asur 10-10-2015 09:30

Re: Hostage Creating Help!!
 
Quote:

Originally Posted by HamletEagle (Post 2351536)
What do you want to do ? Create a true hostage or just some dummy entity that looks like one ? It should be created with a command ? Where should it be created ? At the aim of the player, where the player is on at T spawn ?

Quote:

What do you want to do
-->
PHP Code:

Create a dummy entity

Quote:

It should be created with a command ?
Srry but this one is k by adding this >>
-->
PHP Code:

public plugin_init() { 
    
register_plugin("Hostage Spawner""1.0""NONE"
    
set_task(1.0"host_spawn"


Quote:

Where should it be created ?
-->
PHP Code:

new Float:origin[3] = { -2687.0574.0, -1962.0 

srry for incomplete ques!!!
Now pls help :)

asur 10-13-2015 04:32

Re: Hostage Creating Help!!
 
Help pls ^


All times are GMT -4. The time now is 22:04.

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