Raised This Month: $52 Target: $400
 13% 

error on a plugin for class menu


Post New Thread Reply   
 
Thread Tools Display Modes
PartialCloning
Senior Member
Join Date: Dec 2015
Old 02-10-2019 , 14:21   Re: error on a plugin for class menu
Reply With Quote #11

Try this, reconstructed from your code:
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <engine>
#include <fakemeta>
#include <fun>
#include <hamsandwich>

#pragma semicolon 1

#define m_bHasPrimary 116
#define CBasePlayer 5

new g_PlayersSpeed;

public 
plugin_init()
{
    
register_plugin("Armes/MrGarfield""1.1a-Reconstructed""Jailbreak Shop");

    
RegisterHam(Ham_Spawn"player""PlayerSpawn"1);
    
g_PlayersSpeed register_cvar("players_speed""700");
}

public 
PlayerSpawn(id)
{
    if(!
is_user_alive(id))
        return 
HAM_IGNORED;

    
strip_user_weapons(id);
    
set_pdata_int(idm_bHasPrimary0CBasePlayer);
    
give_item(id"weapon_knife");

    
ShopMenu(idcs_get_user_team(id));
    return 
HAM_IGNORED;
}

ShopMenu(idCsTeams:Team)
{
    switch(
Team)
    {
        case 
CS_TEAM_T:
        {
            new 
Menu menu_create("[Alias#`KraZy] Choisis ta classe de Prisonnier""ShopMenuPrisoner_Handler");

            
menu_additem(Menu"\wAssassin \y- \w[ \rGravite \w]");
            
menu_additem(Menu"\wDealer \y- \w[ \r130Hp \w]");
            
menu_additem(Menu"\wPedobear \y- \w[ \rVitesse \w]");
            
menu_additem(Menu"\wTerroriste \y- \w[ \rHe \w+ \rFlash \w+ \rSmoke \w]");
            
menu_additem(Menu"\wProtecteur \y- \w[ \rArmure \w+ \rSmoke \w] *NEW*");

            
menu_setprop(MenuMPROP_EXITNAME"Quitter");
            
menu_setprop(MenuMPROP_EXITMEXIT_ALL);
            
menu_display(idMenu0);
        }
        case 
CS_TEAM_CT:
        {
            new 
Menu menu_create("[Alias#`KraZy] Choisis ta classe de Garde""ShopMenuGuard_Handler");

            
menu_additem(Menu"\wMilitaire \y- \w[ \rM4 \w+ \rDeagle \w]");
            
menu_additem(Menu"\wSniper \y- \w[ \rAwp \w+ \rDeagle \w]");
            
menu_additem(Menu"\wRambo \y- \w[ \rMitrailleuse \w+ \rUsp \w+ \r30HP \w]");
            
menu_additem(Menu"\wGarde \y- \w[ \rAk47 \w+ \rDeagle \w]");
            
menu_additem(Menu"\wPyro \y- \w[ \rAug \w+ \rDeagle \w] *NEW*");

            
menu_setprop(MenuMPROP_EXITNAME"Quitter");
            
menu_setprop(MenuMPROP_EXITMEXIT_ALL);
            
menu_display(idMenu0);
        }
    }
}

public 
ShopMenuPrisoner_Handler(idMenuItem)
{
    if(
Item == MENU_EXIT || !is_user_alive(id) || cs_get_user_team(id) != CS_TEAM_T)
    {
        
menu_destroy(Menu);
        return 
PLUGIN_HANDLED;
    }

    switch(
Item)
    {
        case 
0set_user_gravity(id0.40);
        case 
1set_user_health(idget_user_health(id) + 30);
        case 
2set_user_maxspeed(idget_pcvar_float(g_PlayersSpeed));
        case 
3:
        {
            
give_item(id"weapon_hegrenade");
            
give_item(id"weapon_flashbang");
            
give_item(id"weapon_smokegrenade");
        }
        case 
4:
        {
            
give_item(id"weapon_smokegrenade");
            
cs_set_user_armor(id100CS_ARMOR_VESTHELM);
        }
    }

    
menu_destroy(Menu);
    return 
PLUGIN_CONTINUE;
}

public 
ShopMenuGuard_Handler(idMenuItem)
{
    if(
Item == MENU_EXIT || !is_user_alive(id) || cs_get_user_team(id) != CS_TEAM_CT)
    {
        
menu_destroy(Menu);
        return 
PLUGIN_HANDLED;
    }

    
strip_user_weapons(id);
    
give_item(id"weapon_knife");

    switch(
Item)
    {
        case 
0:
        {
            
give_item(id"weapon_m4a1");
            
cs_set_user_bpammo(idCSW_M4A19000);

            
give_item(id"weapon_deagle");
            
cs_set_user_bpammo(idCSW_DEAGLE3500);

            
cs_set_user_armor(id100CS_ARMOR_VESTHELM);
        }
        case 
1:
        {
            
give_item(id"weapon_awp");
            
cs_set_user_bpammo(idCSW_AWP9000);

            
give_item(id"weapon_deagle");
            
cs_set_user_bpammo(idCSW_DEAGLE3500);

            
cs_set_user_armor(id100CS_ARMOR_VESTHELM);
        }
        case 
2:
        {
            
give_item(id"weapon_m249");
            
cs_set_user_bpammo(idCSW_M2499000);

            
give_item(id"weapon_usp");
            
cs_set_user_bpammo(idCSW_USP3500);

            
set_user_health(idget_user_health(id) + 30);
        }
        case 
3:
        {
            
give_item(id"weapon_ak47");
            
cs_set_user_bpammo(idCSW_AK479000);

            
give_item(id"weapon_deagle");
            
cs_set_user_bpammo(idCSW_DEAGLE3500);

            
cs_set_user_armor(id100CS_ARMOR_VESTHELM);
        }
        case 
4:
        {
            
give_item(id"weapon_aug");
            
cs_set_user_bpammo(idCSW_AUG9000);

            
give_item(id"weapon_deagle");
            
cs_set_user_bpammo(idCSW_DEAGLE3500);

            
cs_set_user_armor(id100CS_ARMOR_VESTHELM);
        }
    }

    
menu_destroy(Menu);
    return 
PLUGIN_CONTINUE;

PartialCloning is offline
MrGarfield
Member
Join Date: Feb 2013
Old 02-10-2019 , 14:29   Re: error on a plugin for class menu
Reply With Quote #12

thank you for the advice, I would like to know how to recognize an amxx decompiler of a code sma so that this action does not renew thanks again
MrGarfield is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 02-10-2019 , 14:46   Re: error on a plugin for class menu
Reply With Quote #13

This part of the code should never be there:

PHP Code:
public __fatal_ham_error(Ham:idHamError:errString:reason[])
{
    !!! 
Removed Phi
    
if (func != -&& callfunc_begin_i(func, -1) == 1)
    {
        
callfunc_push_int(id);
        
callfunc_push_int(err);
        
callfunc_push_str(reasonfalse);
        if (
callfunc_end() == 1)
        {
            
fail 0;
        }
    }
    if (
fail)
    {
        
set_fail_state(reason);
    }
    return 
0;

Especailly the "!!! Removed Phi" thing - there's no such thing in Pawn scripting.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
MrGarfield
Member
Join Date: Feb 2013
Old 02-10-2019 , 15:30   Re: error on a plugin for class menu
Reply With Quote #14

super thank you very much PartialCloning, the plugin works well, as I told you this plugin was really given to me I would be careful now thanks to all
MrGarfield is offline
Reply


Thread Tools
Display Modes

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 14:15.


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