AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   little help with create block (https://forums.alliedmods.net/showthread.php?t=221556)

risontek22 07-23-2013 12:30

little help with create block
 
PHP Code:

#include <amxmodx>
#include <engine>

new const block_model[] = "models/block.mdl";

public 
plugin_init() 
{
    
register_clcmd("/vytvor","block_create");
}

public 
plugin_precache()
{
    
precache_model(block_model);
}

public 
block_create(id)
{
    new 
Origin[3]
    new 
Float:Origin_Float[3]
    
get_user_origin(id,Origin,3)
    
    
Origin_Float[0] = str_to_float(Origin[0])
    
Origin_Float[1] = str_to_float(Origin[1])
    
Origin_Float[2] = str_to_float(Origin[2])
    
    new 
ent create_entity("info_target"

    
entity_set_string(ent,EV_SZ_classname,"block"); 
    
entity_set_int(ent,EV_INT_movetypeMOVETYPE_NONE); 
    
entity_set_int(ent,EV_INT_solidSOLID_BBOX); 
    
entity_set_model(ent,block_model);
    
entity_set_size(ent,Float:{-100.0,-100.0,-100.0},Float:{100.0,100.0,100.0})
    
entity_set_int(entEV_INT_body3)
    
entity_set_origin(ent,Float:Origin_Float);
    
client_print(id,print_chat,"Entity vytvorena!")


I write /vytvor and it doest create a block pls help ;(

UchihaSkills 07-23-2013 13:02

Re: little help with create block
 
Debug plugin and make sure plugin is running


All times are GMT -4. The time now is 06:24.

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