Raised This Month: $ Target: $400
 0% 

i want to create multiple CLASSNAME


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
gcz
Junior Member
Join Date: Feb 2016
Old 02-18-2017 , 10:38   Re: i want to create multiple CLASSNAME
Reply With Quote #4

that right thank you so mush for scripte

Quote:
Originally Posted by Natsheh View Post
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)
    }

gcz is offline
 



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