AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Compile Pls (https://forums.alliedmods.net/showthread.php?t=228803)

FaNr 10-27-2013 07:38

Compile Pls
 
Can somebody compile this plugin ? :D
Code:

#include < amxmodx >
#include < amxmisc>
#include < engine >
#include < cstrike >
#include < hamsandwich >
#include < fakemeta >
#include < fakemeta_util >
#include < CC_ColorChat >
#include < fun >

#define PLUGIN "Furien Shop"
#define VERSION "0.0.4"
#define AUTHOR "DaNe"

new bool:have_superknife[33];
new bool:have_goldenak[33]
new bool:have_super_black[33]

new have_superknife_v_model [ 66 ] = "models/shop/v_super_knife.mdl"
new have_goldenak_v_model [ 66 ] = "models/shop/v_goldenak.mdl"
new have_super_black_v_model [ 66 ] = "models/shop/v_dragonclaws.mdl"

public plugin_init()
{
    register_plugin(PLUGIN, VERSION, "DaNe");
   
    register_clcmd("say /shop", "FurienShop", 0);
    register_clcmd("say shop", "FurienShop", 0);
    register_clcmd("say_team /shop", "FurienShop", 0);
    register_clcmd("say_team shop", "FurienShop", 0);
    register_event ( "CurWeapon", "CurrentWeapon", "be", "1=1" );
    RegisterHam ( Ham_TakeDamage, "player", "Player_TakeDamage" );
    RegisterHam ( Ham_Spawn, "player", "Spawn", 1 );
    RegisterHam ( Ham_Spawn, "player", "DropWeapons", 1 );
}

public plugin_precache ( )
{
    precache_model ( have_superknife_v_model );
    precache_model ( have_goldenak_v_model );
    precache_model ( have_super_black_v_model
}

public Spawn ( id )
    {
        strip_user_weapons ( id );
        give_item ( id, "weapon_knife" );
        give_item ( id, "weapon_hegrenade" );
        give_item ( id, "weapon_smokegrenade" );
        cs_set_user_bpammo( id, CSW_SMOKEGRENADE, 2 )
        give_item ( id, "weapon_flashbang" );
        cs_set_user_bpammo( id, CSW_FLASHBANG, 2 )
        have_superknife [ id ] = false;
        have_goldenak [ id ] = false;
        have_super_black [ id ] = false;
    }

    public CurrentWeapon ( id )
{
   
    if ( have_superknife [ id ] && get_user_weapon ( id ) == CSW_KNIFE )
    {
        set_pev ( id, pev_viewmodel2, have_superknife_v_model );
    }
    if ( have_goldenak [ id ] && get_user_weapon ( id ) == CSW_AK47 )
    {
        set_pev ( id, pev_viewmodel2, have_goldenak_v_model );
    }
    if ( have_super_black [ id ] && get_user_weapon ( id ) == CSW_KNIFE )
    {
        set_pev ( id, pev_viewmodel2, have_super_black_v_model );
    }
}

public FurienShop ( id )
{
   
    if (get_user_team(id) == 1 )
    {
        set_task( 0.1, "ShowFurien", id );
    }

    if (get_user_team (id ) == 2 )
    {
        set_task( 0.1, "ShowAntiFurien", id );
    }
}

public DropWeapons ( id )
{
    if( !is_user_alive( id ) ) {
    have_superknife [ id ] = false;
    have_super_black [ id ] = false;
    have_goldenak [ id ] = false;
    }
}

public ShowAntiFurien(id, level, cid)

    new menu = menu_create( "\rAnti\w-\rFurien \yBuying", "antifurienhandler");
    menu_additem(menu, "\yGolden \rAK47 \y- \w[ \r9000 \y$ \w]", "1", 0);
    menu_additem(menu, "\yDefuse \rKIT \y- \w[ \r300 \y$ \w]", "2", 0);
    menu_additem(menu, "\y50 \rHP \y- \w[ \r3000 \y$ \w]", "3", 0);
    menu_additem(menu, "\y50 \rAP \y- \w[ \r1000 \y$ \w]", "4", 0);
    menu_additem(menu, "\yHE \rGrenade \y- \w[ \r1200 \y$ \w]", "5", 0);
   
    menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
    menu_display(id, menu, 0);
}

public ShowFurien(id, level, cid)
{   
    new menu = menu_create( "\rFurien \yBuying", "furienhandler");
    menu_additem(menu, "\ySuper \rKnife \y- \w[ \r15000 \y$ \w]", "1", 0);
    menu_additem(menu, "\yHE \rGrenade \y- \w[ \r3000 \y$ \w]", "1", 0);
    menu_additem(menu, "\y50 \rHP \y- \w[ \r3000 \y$ \w]
    menu_additem(menu, "\y100 \rAP \y- \w[ \r10000 \y$ \w]", "1", 0);
    menu_additem(menu, "\yBlack \rPack \y- \w[ \r15000 \y$ \w]", "1", 0);

    menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
    menu_display(id, menu, 0);
}

public furienhandler (id, menu, item, level, cid)
{
    if( item == MENU_EXIT )
    {
        return 1;
    }
   
    new data[6], szName[64];
    new access, callback;
    menu_item_getinfo(menu, item, access, data,charsmax(data), szName,charsmax(szName), callback);
    new key = str_to_num(data);

    switch(key)
    { 
        case 1:
        {   
            new iMoney = cs_get_user_money ( id ) - 15000;
            if( iMoney < 0 )
            {
                ColorChat( id, GREEN, "^x01[ ^x04FurienShop^x01 ]^x03Nu ai destui bani!");
                return 1;
               
            }
            else
            {
                have_superknife[ id ] = true;
                CurrentWeapon( id );
                ColorChat( id, GREEN, "^x01[ ^x04FurienShop^x01 ]^x03Ai cumparat ^x01SuperKnife!");
                DropWeapons;
                return 1;
            }
        }
       
        case 2:
        {   
            new iMoney = cs_get_user_money ( id ) - 3000;
            if( iMoney < 0 )
            {
                ColorChat( id, GREEN, "^x01[ ^x04FurienShop^x01 ]^x03Nu ai destui bani!");
                return 1;
               
            }
            else
            {
                give_item ( id, "weapon_hegrenade" );
                CurrentWeapon( id );
                ColorChat( id, GREEN, "^x01[ ^x04FurienShop^x01 ]^x03Ai cumparat ^x01HeGrenade!");
                DropWeapons;
                return 1;
            }
        }
       
        case 3:
        {   
            new iMoney = cs_get_user_money ( id ) - 3000;
            if( iMoney < 0 )
            {
                ColorChat( id, GREEN, "^x01[ ^x04FurienShop^x01 ]^x03Nu ai destui bani!");
                return 1;
               
            }
            else
            {
                give_item ( id, "weapon_hegrenade" );
                CurrentWeapon( id );
                ColorChat( id, GREEN, "^x01[ ^x04FurienShop^x01 ]^x03Ai cumparat ^x01HeGrenade!");
                DropWeapons;
                return 1;
            }
        }
       
        case 4:
        {
            new iMoney = cs_get_user_money ( id ) - 3000;
            if( iMoney < 0 )
            {
                ColorChat( id, GREEN, "^x01[ ^x04FurienShop^x01 ]^x03Nu ai destui bani !");
                return 1;
               
            }
            else
            {
                new Health = get_user_health ( id );
                if ( Health <= 250 )
            }
            {
                fm_set_user_health ( id, get_user_health ( id ) + 50 );
                ColorChat( id, GREEN, "^x01[ ^x04FurienShop^x01 ]^x03Ai cumparat ^x0150 HP!")
                DropWeapons;
                return 1;
            }
        }
       
        case 5:
        {
            new iMoney = cs_get_user_money ( id ) - 5000;
            if( iMoney < 0 )
            {
                ColorChat( id, GREEN, "^x01[ ^x04FurienShop^x01 ]^x03 Nu ai destui bani");
                return 1;
               
            }
            else
            {
                new Armor = get_user_armor ( id );
                if ( Armor <= 300 )
                {
                    fm_set_user_armor( id, get_user_armor ( id ) + 100 );
                    ColorChat( id, GREEN, "^x01[ ^x04FurienShop^x01 ]^x03 Ai cumparat 100 AP!");
                    DropWeapons;
                    return 1;
                }
            }
        }
       
        case 6:
        {
            new iMoney = cs_get_user_money ( id ) - 5000;
            if( iMoney < 0 )
            {
                ColorChat( id, GREEN, "^x01[ ^x04FurienShop^x01 ]^x03 Nu ai destui bani!");
                return 1;
               
            }
            else
            {
                new Health = get_user_health ( id );
                if ( Health <= 300 )
                {
                   
                    fm_set_user_armor( id, get_user_armor ( id ) + 250 );
                    give_item ( id, "weapon_hegrenade" );
                    cs_set_user_bpammo( id, CSW_HEGRENADE, 3 )
                    have_super_black[ id ] = true;
                    ColorChat( id, GREEN, "^x01[ ^x04FurienShop^x01 ]^x03 Ai cumparat ^x01BlackPack!");
                    DropWeapons;
                    return 1;
                }
            }
        }
    }
    menu_destroy(menu);
    return 1;
}

public antifurienhandler(id, menu, item, level, cid)
{
        if( item == MENU_EXIT )
        {
        return 1;
        }
   
        new data[6], szName[64];
        new access, callback;
        menu_item_getinfo(menu, item, access, data,charsmax(data), szName,charsmax(szName), callback);
        new key = str_to_num(data);
   
    switch(key)
    {
        case 1:
        {   
            new iMoney = cs_get_user_money ( id ) - 9000;
            if( iMoney < 0 )
            {
                ColorChat( id, GREEN, "^x01[ ^x04FurienShop^x01 ]^x03Nu ai destui bani!");
                return 1;
               
            }
            else
            {
                have_goldenak[ id ] = true;
                give_item ( id, "weapon_ak47" );
                cs_set_user_bpammo( id, CSW_AK47, 250 )
                CurrentWeapon( id );
                ColorChat( id, GREEN, "^x01[ ^x04FurienShop^x01 ]^x03Ai cumparat ^x01GoldenAk!");
                DropWeapons;
                return 1;
            }
        }
       
        case 2:
        {
            new iMoney = cs_get_user_money ( id ) - 300;
            if( iMoney < 0 )
            {
                ColorChat( id, GREEN, "^x01[ ^x04FurienShop^x01 ]^x03Nu ai destui bani!");
                return 1;
               
            }
            else
            {
                fm_give_item ( id, "item_thighpack" );
                ColorChat( id, GREEN, "^x01[ ^x04FurienShop^x01 ]^x03Ai cumparat ^x01DefuseKit!");
                DropWeapons;
                return 1;
            }
        }
       
        case 3:
        {
            new iMoney = cs_get_user_money ( id ) - 3000;
            if( iMoney < 0 )
            {
                ColorChat( id, GREEN, "^x01[ ^x04FurienShop^x01 ]^x03Nu ai destui bani !");
                return 1;
               
            }
            else
            {
                new Health = get_user_health ( id );
                if ( Health <= 250 )
            }
            {
                fm_set_user_health ( id, get_user_health ( id ) + 50 );
                ColorChat( id, GREEN, "^x01[ ^x04FurienShop^x01 ]^x03Ai cumparat ^x0150 HP!")
                return 1;
            }
        }
       
        case 4:
        {
            new iMoney = cs_get_user_money ( id ) - 5000;
            if( iMoney < 0 )
            {
                ColorChat( id, GREEN, "^x01[ ^x04FurienShop^x01 ]^x03 Nu ai destui bani");
                return 1;
               
            }
            else
            {
                new Armor = get_user_armor ( id );
                if ( Armor <= 300 )
                {
                    fm_set_user_armor( id, get_user_armor ( id ) + 50 );
                    ColorChat( id, GREEN, "^x01[ ^x04FurienShop^x01 ]^x03 Ai cumparat 50 AP!");
                    return 1;
                }
            }
        }
       
        case 5:
        {   
            new iMoney = cs_get_user_money ( id ) - 1200;
            if( iMoney < 0 )
            {
                ColorChat( id, GREEN, "^x01[ ^x04FurienShop^x01 ]^x03Nu ai destui bani!");
                return 1;
               
            }
            else
            {
                give_item ( id, "weapon_hegrenade" );
                CurrentWeapon( id );
                ColorChat( id, GREEN, "^x01[ ^x04FurienShop^x01 ]^x03Ai cumparat ^x01HeGrenade!");
                return 1;
            }
        }
    }
   
    menu_destroy(menu);
    return 1;
}

public Player_TakeDamage ( iVictim, iInflictor, iAttacker, Float:fDamage, iDamageBits )
{
    if( iInflictor == iAttacker && have_superknife [ iAttacker ] && is_user_alive( iAttacker ) && get_user_weapon( iAttacker ) == CSW_KNIFE && cs_get_user_team( iAttacker ) == CS_TEAM_T )
    {
        SetHamParamFloat( 4, fDamage * 3.0);
        return HAM_HANDLED;
    }
    if( iInflictor == iAttacker && have_super_black [ iAttacker ] && is_user_alive( iAttacker ) && get_user_weapon( iAttacker ) == CSW_KNIFE && cs_get_user_team( iAttacker ) == CS_TEAM_T )
    {
        SetHamParamFloat( 4, fDamage * 4.0);
        return HAM_HANDLED;
    }
    if( iInflictor == iAttacker && have_goldenak [ iAttacker ] && is_user_alive( iAttacker ) && get_user_weapon( iAttacker ) == CSW_AK47 && cs_get_user_team( iAttacker ) == CS_TEAM_CT )
    {
        SetHamParamFloat( 4, fDamage * 3.0);
        return HAM_HANDLED;
    }
}


YamiKaitou 10-27-2013 08:12

Re: Compile Pls
 
We cannot attach the AMXX file to a post. Why can you not compile it yourself?

FaNr 10-27-2013 13:08

Re: Compile Pls
 
Quote:

Originally Posted by YamiKaitou (Post 2053433)
We cannot attach the AMXX file to a post. Why can you not compile it yourself?

I have errors ! :D

wickedd 10-27-2013 13:33

Re: Compile Pls
 
Quote:

Originally Posted by FaNr (Post 2053510)
I have errors ! :D

Should we guess what errors are? :twisted:

BLacking98 10-28-2013 04:00

Re: Compile Pls
 
"#include < CC_ColorChat >" ?
Never heard of such include, can you give me the link to it ?

EDIT: Maybe that's because you can't compile (probably) you don't have the include or the include's name is incorrectly written

dark_style 10-28-2013 04:52

Re: Compile Pls
 
I think that it's Connor's colorchat.

YamiKaitou 10-28-2013 04:57

Re: Compile Pls
 
Quote:

Originally Posted by dark_style (Post 2053730)
I think that it's Connor's colorchat.

If that is the case, he renamed the file then as that is not the original filename

dark_style 10-28-2013 15:12

Re: Compile Pls
 
Yes, that is the only thing I can think of:

ConnorMCLeod_ColorChat.

BLacking98 10-28-2013 15:47

Re: Compile Pls
 
Quote:

Originally Posted by dark_style (Post 2053893)
Yes, that is the only thing I can think of:

ConnorMCLeod_ColorChat.

No, it would be CM, ANYWAYS he didn't make one with this name. OR it's wrong inside the .sma or the person that wrote the plugin actually had color chat renamed to that.
Simple

D3XT3R 02-20-2017 08:59

Re: Compile Pls
 
Quote:

Originally Posted by BLacking98 (Post 2053714)
"#include < CC_ColorChat >" ?
Never heard of such include, can you give me the link to it ?

EDIT: Maybe that's because you can't compile (probably) you don't have the include or the include's name is incorrectly written

this is this inc and it compiled :D
PHP Code:

/*                          __________________________________
*                    |Functiile originade create de Numb|
*                    ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ

*                 Fisier rescris si fixat de Askhanar.
*

*                Copyright İ 2012, Askhanar @disconnect.ro
*            Acest fisier este prevazut asa cum este ( fara garantii )
*/

#if defined _CC_ColorChat_included
  #endinput
#endif
#define _CC_ColorChat_included

enum Color
{
    
NORMAL 1,         // Culoarea care o are jucatorul setata in cvar-ul scr_concolor.
    
GREEN,             // Culoare Verde.
    
TEAM_COLOR,         // Culoare Rosu, Albastru, Gri.
    
GREY,             // Culoarea Gri.
    
RED,             // Culoarea Rosu.
    
BLUE,             // Culoarea Albastru.
}

new 
TeamName[  ][  ] = 
{
    
"",
    
"TERRORIST",
    
"CT",
    
"SPECTATOR"
}

ColorChat(  idColor:iType, const msg[  ], { FloatSqlResult_}:...  )
{
    
    
// Daca nu se afla nici un jucator pe server oprim TOT. Altfel dam de erori..
    
if( !get_playersnum( ) ) return;
    
    new 
szMessage256 ];

    switch( 
iType )
    {
         
// Culoarea care o are jucatorul setata in cvar-ul scr_concolor.
        
case NORMAL:    szMessage] = 0x01;
        
        
// Culoare Verde.
        
case GREEN:    szMessage] = 0x04;
        
        
// Alb, Rosu, Albastru.
        
default:     szMessage] = 0x03;
    }

    
vformat(  szMessage], 251msg4  );

    
// Ne asiguram ca mesajul nu este mai lung de 192 de caractere.Altfel pica server-ul.
    
szMessage192 ] = '^0';
    

    new 
iTeamiColorChangeiPlayerIndexMSG_Type;
    
    if( 
id )
    {
        
MSG_Type  =  MSG_ONE_UNRELIABLE;
        
iPlayerIndex  =  id;
    }
    else
    {
        
iPlayerIndex  =  CC_FindPlayer(  );
        
MSG_Type MSG_ALL;
    }
    
    
iTeam  =  get_user_teamiPlayerIndex );
    
iColorChange  =  CC_ColorSelection(  iPlayerIndex,  MSG_TypeiType);

    
CC_ShowColorMessage(  iPlayerIndexMSG_TypeszMessage  );
        
    if(  
iColorChange  )    CC_Team_Info(  iPlayerIndexMSG_Type,  TeamNameiTeam ]  );

}

CC_ShowColorMessage(  id, const iType, const szMessage[  ]  )
{
    
    static 
bool:bSayTextUsed;
    static 
iMsgSayText;
    
    if(  !
bSayTextUsed  )
    {
        
iMsgSayText  =  get_user_msgid"SayText" );
        
bSayTextUsed  =  true;
    }
    
    
message_beginiTypeiMsgSayText_id  );
    
write_byte(  id  )        
    
write_string(  szMessage  );
    
message_end(  );
}

CC_Team_Infoid, const iType, const szTeam[  ] )
{
    static 
bool:bTeamInfoUsed;
    static 
iMsgTeamInfo;
    if(  !
bTeamInfoUsed  )
    {
        
iMsgTeamInfo  =  get_user_msgid"TeamInfo" );
        
bTeamInfoUsed  =  true;
    }
    
    
message_beginiTypeiMsgTeamInfo_id  );
    
write_byte(  id  );
    
write_string(  szTeam  );
    
message_end(  );

    return 
1;
}

CC_ColorSelection(  id, const iTypeColor:iColorType)
{
    switch(  
iColorType  )
    {
        
        case 
RED:    return CC_Team_Info(  idiTypeTeamName]  );
        case 
BLUE:    return CC_Team_Info(  idiTypeTeamName]  );
        case 
GREY:    return CC_Team_Info(  idiTypeTeamName]  );

    }

    return 
0;
}

CC_FindPlayer(  )
{
    new 
iMaxPlayers  =  get_maxplayers(  );
    
    for( new 
1<= iMaxPlayersi++ )
        if(  
is_user_connected)  )
            return 
i;
    
    return -
1;




All times are GMT -4. The time now is 23:22.

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