Raised This Month: $32 Target: $400
 8% 

I have no ideea


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Ykaru
Member
Join Date: Aug 2019
Old 01-28-2020 , 14:54   I have no ideea
Reply With Quote #1

Hello, can you help me with this ? Ik, im noob etc..

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <fakemeta_util>
#include <cstrike>
#include <hamsandwich>
#include <engine>
#include <colorchat>

#define PLUGIN "[Furien]Vip System"
#define VERSION "0.1"
#define AUTHOR "[Ecstasy]"

#define VIP_FLAGS    ADMIN_LEVEL_A    //Aici modifici cu accesul dorit !

#define IsPlayer(%0)    ( 1 <= %0 <= g_iMaxPlayers )
new g_iMaxPlayers;

new 
boolHaveItem33 ];
new 
bool:he[33], bool:sg[33], bool:fb[33];

// |--> Weapon
new boolAk4733 ];
new 
boolM4A133 ];
new 
boolDeagle33 ];
new 
boolSuperKnife33 ];

new 
vAk4764 ] = "models/v_kriptyAK.mdl";    // Modifica cu locul si numele modelelor
new pAk4764 ] = "models/p_kriptyAK.mdl";    // Modifica cu locul si numele modelelor

new vM4A164 ] = "models/v_kriptyM4.mdl";    // Modifica cu locul si numele modelelor
new pM4A164 ] = "models/p_kriptyM4.mdl";    // Modifica cu locul si numele modelelor

new vDeagle64 ] = "models/v_kriptyDEAGLE.mdl";    // Modifica cu locul si numele modelelor
new pDeagle64 ] = "models/p_kriptyDEAGLE.mdl";    // Modifica cu locul si numele modelelor

new vSuperKnife64 ] = "models/v_kriptyKNIFE.mdl";    // Modifica cu locul si numele modelelor

// |--> Cvar's
new cvar_hp_spawn_tcvar_ap_spawn_tcvar_hp_spawn_ctcvar_ap_spawn_ct;
new 
regenerator_hpregenerator_timeregenerator_max_hp;
new 
vip_money_tvip_money_ct;

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
//Cvar's
    
cvar_hp_spawn_t register_cvar("vip_hp_spawn_t""200");
    
cvar_ap_spawn_t register_cvar("vip_ap_spawn_t""100");
    
cvar_hp_spawn_ct register_cvar("vip_hp_spawn_ct""200");
    
cvar_ap_spawn_ct register_cvar("vip_ap_spawn_ct""100");
    
regenerator_hp register_cvar("vip_regenerator_hp""5");
    
regenerator_time register_cvar("vip_regenerator_time""5");
    
regenerator_max_hp register_cvar("vip_regenerator_max_hp""100");
    
vip_money_t register_cvar("vip_money_furien""3000");
    
vip_money_ct register_cvar("vip_money_antifurien""3000");
    
    
register_clcmd"say""VipSay");
    
register_clcmd"say_team""VipSay");
    
    
RegisterHamHam_Spawn"player""SpawnCmd"true);
    
RegisterHam Ham_TakeDamage"player""Player_TakeDamage" );
    
    
g_iMaxPlayers get_maxplayers (     );
    
    
register_event"DeathMsg""eDeathMsg""a" );
    
register_event"CurWeapon""CurrWeapon""be""1=1" );
    
// Add your code here...
}

public 
plugin_precache( ) {
    
    
precache_model(vAk47);
    
precache_model(pAk47);
    
    
precache_model(vM4A1);
    
precache_model(pM4A1);
    
    
precache_model(vDeagle);
    
precache_model(pDeagle);
    
    
precache_model(vSuperKnife);
}

public 
SpawnCmd id ) {
    
    if(
get_user_flags(id) & VIP_FLAGS) {
        if(
is_user_alive(id)) {
            switch(
get_user_team(id))
            {
                case 
1:
                {
                    
fm_set_user_health(idget_pcvar_numcvar_hp_spawn_t ) );
                    
fm_set_user_armor(idget_pcvar_numcvar_ap_spawn_t ) );
                    
RegeneratorHPid );
                    
HaveItemid ] = false;
                    
heid ] = false;
                    
sgid ] = false;
                    
fbid ] = false;
                    
Ak47id ] = false;
                    
M4A1id ] = false;
                    
Deagleid ] = false;
                    
SuperKnifeid ] = false;
                }
                case 
2:
                {
                    
fm_set_user_health(idget_pcvar_numcvar_hp_spawn_ct ) );
                    
fm_set_user_armor(idget_pcvar_numcvar_ap_spawn_ct ) );
                    
RegeneratorHPid );
                    
heid ] = false;
                    
sgid ] = false;
                    
fbid ] = false;
                    
HaveItemid ] = false;
                    
Ak47id ] = false;
                    
M4A1id ] = false;
                    
Deagleid ] = false;
                    
SuperKnifeid ] = false;
                }
            }
        }
    }
    return 
0;
}

public 
RegeneratorHPid ) {
    
    if(
get_user_flags(id) & VIP_FLAGS) {
        new 
iHealth get_user_health(id);
        if(
iHealth <= 25) {
            
RegeneratorCmd(id);
        }
        
RegeneratorHPid );
    }
    return 
0;
}
public 
RegeneratorCmd(id) {
    new 
iHealth get_user_health(id);
    if(
iHealth get_pcvar_numregenerator_max_hp )) {
        
fm_set_user_health(idiHealth get_pcvar_numregenerator_hp ) );
        
set_task(float(get_pcvar_numregenerator_time )), "RegeneratorCmd"id);
    }
    else
    {
        return 
1;
    }
    return 
0;
}

public 
eDeathMsg id ) {
    if(
get_user_flags(id) & VIP_FLAGS) {
        new 
iKiller read_data);
        switch(
get_user_team(id))
        {
            case 
1:
            {
                
cs_set_user_money(iKillercs_get_user_money(id) + get_pcvar_numvip_money_t ));
            }
            case 
2:
            {
                
cs_set_user_money(iKillercs_get_user_money(id) + get_pcvar_numvip_money_ct ));
            }
        }
    }
}
public 
VipSay id ) {
    
    new 
say[192];
    
read_args(say192);
    if(
contain(say"/vipmenu") != -|| contain(say"/furienvip") != -1) {
        if(
get_user_flags(id) & VIP_FLAGS) {
            
VIPMenuCmd(id);
        }
        else
        {
            
ColorChat(idRED"^x04[VIP]^x01 Doar cei cu VIP pot accesa acest meniu");
            return 
1;
        }
    }
    return 
0;
}
public 
VIPMenuCmd(id) {
    
    new 
VIPMenu menu_create"\yVIP \wMenu""VIPGiver" )
    switch(
get_user_team(id))
    {
        case 
1:
        {
            
menu_additemVIPMenu"\yAk47 Gold + Deagle Gold - \r(2xDMG)""1")
            
menu_additemVIPMenu"\yM4a1 Gold + Deagle Gold - \r(2xDMG)""2")
        }
        case 
2:
        {
            
menu_additemVIPMenu"\ySuperKnife - \r(2xDMG)""1")
        }
    }
    
    
    
menu_setpropVIPMenuMPROP_EXITMEXIT_ALL )
    
menu_displayidVIPMenu)
    
}

public 
VIPGiveridVIPMenuitem ) {
    
    if( !(
is_user_aliveid )) )  {
        
ColorChat(idRED"^x04[VIP]^x01 Nu mai poti accesa meniul daca ai murit!" )
        return 
PLUGIN_HANDLED;
    }
    if( 
HaveItemid ] ) {
        
ColorChat(idRED"^x04[VIP]^x01 Ai ales deja runda asta." )
        return 
PLUGIN_HANDLED;
    }
    
    if( 
item == MENU_EXIT )  {
        
menu_destroyVIPMenu )
        return 
PLUGIN_HANDLED;
    }
    
    switch(
get_user_team(id))
    {
        case 
1:
        {
            switch( 
item 
            {
                case 

                {
                    if(
get_user_weapon(id) == CSW_HEGRENADE) {
                        
heid ] = true;
                    }
                    if(
get_user_weapon(id) == CSW_SMOKEGRENADE) {
                        
sgid ] = true;
                    }
                    if(
get_user_weapon(id) == CSW_FLASHBANG) {
                        
fbid ] = true;
                    }
                    
fm_strip_user_weapons(id);
                    
fm_give_item(id"weapon_knife");
                    
fm_give_item(id"weapon_deagle");
                    
fm_give_item(id"weapon_ak47");
                    
cs_set_user_bpammo(idCSW_DEAGLE70);
                    
cs_set_user_bpammo(idCSW_AK4790);
                    
Ak47id ] = true;
                    
CurrWeapon(id);
                    
HaveItemid ] = true;
                    if(
he[id]) {
                        
fm_give_item(id"weapon_hegrenade");
                    }
                    if(
sg[id]) {
                        
fm_give_item(id"weapon_smokegrenade");
                    }
                    if(
fb[id]) {
                        
fm_give_item(id"weapon_flashbang");
                    }
                }
                case 
:
                {
                    if(
get_user_weapon(id) == CSW_HEGRENADE) {
                        
heid ] = true;
                    }
                    if(
get_user_weapon(id) == CSW_SMOKEGRENADE) {
                        
sgid ] = true;
                    }
                    if(
get_user_weapon(id) == CSW_FLASHBANG) {
                        
fbid ] = true;
                    }
                    
fm_strip_user_weapons(id);
                    
fm_give_item(id"weapon_knife");
                    
fm_give_item(id"weapon_deagle");
                    
fm_give_item(id"weapon_m4a1");
                    
cs_set_user_bpammo(idCSW_DEAGLE70);
                    
cs_set_user_bpammo(idCSW_M4A190);
                    
M4A1id ] = true;
                    
CurrWeapon(id);
                    
HaveItemid ] = true;
                    if(
he[id]) {
                        
fm_give_item(id"weapon_hegrenade");
                    }
                    if(
sg[id]) {
                        
fm_give_item(id"weapon_smokegrenade");
                    }
                    if(
fb[id]) {
                        
fm_give_item(id"weapon_flashbang");
                    }
                }
            }
        }
        case 
2:
        {
            switch( 
item 
            {
                case 

                {
                    if(
get_user_weapon(id) == CSW_HEGRENADE) {
                        
heid ] = true;
                    }
                    if(
get_user_weapon(id) == CSW_SMOKEGRENADE) {
                        
sgid ] = true;
                    }
                    if(
get_user_weapon(id) == CSW_FLASHBANG) {
                        
fbid ] = true;
                    }
                    
fm_strip_user_weapons(id);
                    
fm_give_item(id"weapon_knife");
                    
SuperKnifeid ] = true;
                    
CurrWeapon(id);
                    
HaveItemid ] = true;
                    if(
he[id]) {
                        
fm_give_item(id"weapon_hegrenade");
                    }
                    if(
sg[id]) {
                        
fm_give_item(id"weapon_smokegrenade");
                    }
                    if(
fb[id]) {
                        
fm_give_item(id"weapon_flashbang");
                    }    
                }
            }
        }
    }
    
menu_destroyVIPMenu )
    return 
PLUGIN_HANDLED;
}
public 
CurrWeapon id ) {
    
    
    if ( 
SuperKnife id ] && get_user_weapon id ) == CSW_KNIFE ) {
        
        
set_pev idpev_viewmodel2vSuperKnife );
    }
    if ( 
Ak47 id ] && get_user_weapon id ) == CSW_AK47 ) {
        
        
set_pev idpev_viewmodel2vAk47 );
        
set_pev idpev_weaponmodel2pAk47 );
    }
    if ( 
M4A1 id ] && get_user_weapon id ) == CSW_M4A1 ) {
        
        
set_pev idpev_viewmodel2vM4A1 );
        
set_pev idpev_weaponmodel2pM4A1 );
    }
    if ( 
Deagle id ] && get_user_weapon id ) == CSW_DEAGLE ) {
        
        
set_pev idpev_viewmodel2vDeagle );
        
set_pev idpev_weaponmodel2pDeagle );
    }
}
public 
Player_TakeDamage iVictimiInflictoriAttackerFloat:fDamageiDamageBits 
    {
    if ( 
IsPlayer iAttacker ) ) {
        
        
        if( 
get_user_weaponiAttacker ) == CSW_KNIFE && SuperKnifeiAttacker ] && cs_get_user_teamiAttacker ) == CS_TEAM_T  
            {
            
SetHamParamFloat4fDamage )
            return 
HAM_HANDLED;
        }
        if( 
get_user_weaponiAttacker ) == CSW_KNIFE && Ak47iAttacker ] && cs_get_user_teamiAttacker ) == CS_TEAM_CT  
            {
            
SetHamParamFloat4fDamage )
            return 
HAM_HANDLED;
        }
        if( 
get_user_weaponiAttacker ) == CSW_KNIFE && M4A1iAttacker ] && cs_get_user_teamiAttacker ) == CS_TEAM_CT  
            {
            
SetHamParamFloat4fDamage )
            return 
HAM_HANDLED;
        }
        if( 
get_user_weaponiAttacker ) == CSW_DEAGLE && DeagleiAttacker ] && cs_get_user_teamiAttacker ) == CS_TEAM_CT  
            {
            
SetHamParamFloat4fDamage )
            return 
HAM_HANDLED;
        }
    }
    
    return 
HAM_IGNORED;

I can compilet, i put all the models etc. But when i join the server it just crash the server.

Last edited by Ykaru; 01-28-2020 at 15:54.
Ykaru is offline
thEsp
BANNED
Join Date: Aug 2017
Old 01-28-2020 , 16:02   Re: I have no ideea
Reply With Quote #2

Hello Ykaru, I don't see anything suspicious in this script, probably there is another problem in your server. Are you sure you have all the models in their folder? If yes, then can you please enable debug option for this plugin and post the logs? It helps us figure out where the problem is. :)
thEsp is offline
Ykaru
Member
Join Date: Aug 2019
Old 01-28-2020 , 16:42   Re: I have no ideea
Reply With Quote #3

AMXX] [631] VipFurien.sma::RegeneratorHP (line 133)

This is the error and now i dont know why but i can use /furienvip as ct and /vipmenu as T.
But its suppose /furienvip to work for T and /vipmenu for CT.

Last edited by Ykaru; 01-28-2020 at 16:45.
Ykaru is offline
Nutu_
AlliedModders Donor
Join Date: Mar 2016
Location: Germany
Old 01-28-2020 , 18:36   Re: I have no ideea
Reply With Quote #4

since you said it crashed the server, how were you able to use /vipmenu?
if server got crush and stopped working thats 100% from one model (.mdl), try to check the name of everything and check if everything is there! and server won't crash/stop

2nd, it shows to you the same because the plugin made it the same
PHP Code:
    if(contain(say"/vipmenu") != -|| contain(say"/furienvip") != -1) {
        if(
get_user_flags(id) & VIP_FLAGS) {
            
VIPMenuCmd(id);
        } 
__________________
a simple act of caring creates an endless ripple.
Nutu_ is offline
Ykaru
Member
Join Date: Aug 2019
Old 01-28-2020 , 18:42   Re: I have no ideea
Reply With Quote #5

Quote:
Originally Posted by Nutu_ View Post
since you said it crashed the server, how were you able to use /vipmenu?
if server got crush and stopped working thats 100% from one model (.mdl), try to check the name of everything and check if everything is there! and server won't crash/stop

2nd, it shows to you the same because the plugin made it the same
PHP Code:
    if(contain(say"/vipmenu") != -|| contain(say"/furienvip") != -1) {
        if(
get_user_flags(id) & VIP_FLAGS) {
            
VIPMenuCmd(id);
        } 
I said now server dont crash anymore but it still does that thing with /furienvip and /vipmenu
And what should i do there ? I mean im not a scripter.. I just need some help

Last edited by Ykaru; 01-28-2020 at 18:43.
Ykaru is offline
Nutu_
AlliedModders Donor
Join Date: Mar 2016
Location: Germany
Old 01-29-2020 , 14:19   Re: I have no ideea
Reply With Quote #6

in what i can see on this plugin, there are no two menus, only that one, that's why it shows you the same menu..
__________________
a simple act of caring creates an endless ripple.
Nutu_ 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 23:39.


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