AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Create PLant Possible? (https://forums.alliedmods.net/showthread.php?t=88295)

Empowers 03-22-2009 17:01

Create PLant Possible?
 
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?

Hunter-Digital 03-22-2009 18:23

Re: Create PLant Possible?
 
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 :?

Empowers 03-22-2009 18:34

Re: Create PLant Possible?
 
Quote:

Set the max and min size, that could work..
please, explain how to do that

Hunter-Digital 03-22-2009 18:39

Re: Create PLant Possible?
 
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

Empowers 03-23-2009 05:28

Re: Create PLant Possible?
 
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"
*/ 


Hunter-Digital 03-23-2009 08:33

Re: Create PLant Possible?
 
EDIT: ehh... try first setting it SOLID :lol: the the method below :P


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;




All times are GMT -4. The time now is 08:55.

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