Raised This Month: $ Target: $400
 0% 

Create PLant Possible?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Empowers
BANNED
Join Date: Feb 2009
Location: Ukraine
Old 03-22-2009 , 17:01   Create PLant Possible?
Reply With Quote #1

Is it possible to create planting point via Amxx? I tryed this:
PHP Code:
#include <amxmodx>
#include <fakemeta>

#define fm_create_entity(%1) engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, %1))

public plugin_precache() 
{
       new 
iEnt fm_create_entity("func_bomb_target"
       
SetKeyValue(iEnt"model""*1""func_bomb_target")
       
SetKeyValue(iEnt"origin","145 -418 53""func_bomb_target")
       
dllfunc(DLLFunc_SpawniEnt
}  

SetKeyValue(iEnt, const szKey[], const szValue[], const szClassName[])  
{  
    
set_kvd(0KV_ClassNameszClassName)  
    
set_kvd(0KV_KeyNameszKey)  
    
set_kvd(0KV_ValueszValue)  
    
set_kvd(0KV_fHandled0)  
    
dllfunc(DLLFunc_KeyValueiEnt0)  
}

/*
"origin" "145 -418 53"
"model" "*1"
"classname" "func_bomb_target"
*/ 
but it doesn't work.. Any suggestions?

Last edited by Empowers; 03-22-2009 at 17:09.
Empowers is offline
Send a message via ICQ to Empowers
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 03-22-2009 , 18:23   Re: Create PLant Possible?
Reply With Quote #2

Set the max and min size, that could work... if not, search for plugins that create solid base entities... like trigger_hurt or something, still I think there is a plugin that creates bombsites
__________________
Hunter-Digital is offline
Empowers
BANNED
Join Date: Feb 2009
Location: Ukraine
Old 03-22-2009 , 18:34   Re: Create PLant Possible?
Reply With Quote #3

Quote:
Set the max and min size, that could work..
please, explain how to do that
Empowers is offline
Send a message via ICQ to Empowers
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 03-22-2009 , 18:39   Re: Create PLant Possible?
Reply With Quote #4

Code:
engfunc(EngFunc_SetSize, ent, {25.0, 25.0, 25.0}, {25.0, 25.0, 25.0})
you can use variables for this also, float arrays of 3 values
__________________
Hunter-Digital is offline
Empowers
BANNED
Join Date: Feb 2009
Location: Ukraine
Old 03-23-2009 , 05:28   Re: Create PLant Possible?
Reply With Quote #5

No effect..
PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

#define fm_create_entity(%1) engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, %1))
#define fm_entity_set_size(%1,%2,%3) engfunc(EngFunc_SetSize, %1, %2, %3)

public plugin_precache() 
{
       new 
iEnt fm_create_entity("func_bomb_target"
       
       
SetKeyValue(iEnt"model""*18""func_bomb_target")
       
SetKeyValue(iEnt"target""targetc""func_bomb_target")
       
SetKeyValue(iEnt"origin","145 -418 53""func_bomb_target")
       
       
fm_entity_set_size(iEnt, {-25.0, -25.0, -25.0}, {25.025.025.0})
       
       
dllfunc(DLLFunc_SpawniEnt)
       
ExecuteHam(Ham_PrecacheiEnt)
}  

SetKeyValue(iEnt, const szKey[], const szValue[], const szClassName[])  
{  
    
set_kvd(0KV_ClassNameszClassName)  
    
set_kvd(0KV_KeyNameszKey)  
    
set_kvd(0KV_ValueszValue)  
    
set_kvd(0KV_fHandled0)  
    
dllfunc(DLLFunc_KeyValueiEnt0)  
}

/*
"origin" "145 -418 53"
"model" "*18"
"target" "targetc"
"classname" "func_bomb_target"
*/ 
Empowers is offline
Send a message via ICQ to Empowers
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 03-23-2009 , 08:33   Re: Create PLant Possible?
Reply With Quote #6

EDIT: ehh... try first setting it SOLID the the method below


well you could make zones (search "zone" in plugins to see how) and then get an bombsite entity ID and faketouch it when the player gets in the zone you specified... or create one entity somewhere outside of the map (if the map doesn't have one or some other issues... )... like fakedamage does:

PHP Code:
stock fm_fakedamage(victim, const classname[], Float:takedmgdamagedamagetype) {
    new class[] = 
"trigger_hurt";
    new 
entity fm_create_entity(class);
    if (!
entity)
        return 
0;
 
    new 
value[16];
    
float_to_str(takedmgdamage 2valuesizeof value 1);
    
fm_set_kvd(entity"dmg"value, class);
 
    
num_to_str(damagetypevaluesizeof value 1);
    
fm_set_kvd(entity"damagetype"value, class);
 
    
fm_set_kvd(entity"origin""8192 8192 8192", class);
    
fm_DispatchSpawn(entity);
 
    
set_pev(entitypev_classnameclassname);
    
fm_fake_touch(entityvictim);
    
fm_remove_entity(entity);
 
    return 
1;

__________________

Last edited by Hunter-Digital; 03-23-2009 at 10:01.
Hunter-Digital 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 08:55.


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