Raised This Month: $ Target: $400
 0% 

i want to create multiple CLASSNAME


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Natsheh
Veteran Member
Join Date: Sep 2012
Old 02-17-2017 , 09:37   Re: i want to create multiple CLASSNAME
Reply With Quote #3

PHP Code:
/* Plugin generated by AMXX-Studio */
  
#include <amxmodx>
#include <amxmisc>
#include <engine>
  
#define PLUGIN "Chickens"
#define VERSION "1.0"
#define AUTHOR "Natsheh"

#define CHICKEN_CLASSNAME "chicken"

new g_Model[] = {"models/chick.mdl"}
  
public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("say""clcmd_say")
    
register_clcmd("say_team""clcmd_say")
}

public 
plugin_precache()
{
    
precache_model(g_Model)
}

public 
clcmd_say(idlevelcid)
{
    new 
sString[40]
    
read_args(sStringcharsmax(sString))
    
remove_quotes(sString)
    
    new 
sCmd[16], sAmount[4];
    
strtok(sStringsCmdcharsmax(sCmd), sAmountcharsmax(sAmount))
    
    if(
equali(sCmd"/chicken") || equali(sCmd"!chicken"))
    {
        new 
iAmount str_to_num(sAmount);
        if(
iAmount <= 0iAmount 1;
        
add_chicken(idiAmount)
    }
}

public 
add_chicken(idamount)
{
    new 
iEnt = -1Float:f_Origin[3], Float:angles[3], iChickens;
    new 
sWord[24], sName[32], i;
    
    while( (
find_ent_by_class(iEntCHICKEN_CLASSNAME) != 0) )
    {
        
iChickens ++;
    }
    
    new 
newamount iChickens amount;
        
    for(
iChickensnewamounti++)
    {
        
iEnt create_entity("info_target")
    
        if(!
is_valid_ent(iEnt))
        {
            continue;
        }
        
        
entity_set_model(iEntg_Model)
        
entity_set_size(iEntFloat:{-6.0, -10.00.0}, Float:{6.010.018.0})
        
entity_get_vector(idEV_VEC_originf_Origin)    
        
f_Origin[0] += 50.0
        entity_set_origin
(iEntf_Origin)
        
entity_set_int(iEntEV_INT_solidSOLID_BBOX)
        
entity_set_string(iEntEV_SZ_classnameCHICKEN_CLASSNAME);
        
entity_set_float(iEntEV_FL_takedamageDAMAGE_YES)
        
entity_set_vector(iEntEV_VEC_anglesangles)
        
num_to_word(isWordcharsmax(sWord))
        
formatex(sNamecharsmax(sName), "chicken_%s"sWord)
        
entity_set_string(iEntEV_SZ_globalnamesName)
        
        
drop_to_floor(iEnt)
    }

__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 02-17-2017 at 09:59.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
 



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 20:59.


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