AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   error on a plugin for class menu (https://forums.alliedmods.net/showthread.php?t=314232)

MrGarfield 02-09-2019 09:25

error on a plugin for class menu
 
hello a friend passed me this sma, I would like the same for my mode jail a menu for prisoners and guardians but there is a mistake can you help me thank you.

Code:

#include <amxmodx>
#include <fakemeta>
#include <engine>
#include <cstrike>
#pragma semicolon 1
#pragma ctrlchar '\'

new g_PlayersSpeed;

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

public plugin_init()
{
    register_plugin("Armes", "1.1a", "");
    RegisterHam(Ham_Spawn, "player", "PlayerSpawn", 1);
    g_PlayersSpeed = register_cvar("players_speed", "700", 0, 0.00);
    return 0;
}

public PlayerSpawn(id)
{
    if (is_user_alive(id))
    {
        strip_user_weapons(id);
        set_pdata_int(id, 116, 0, 5);
        give_item(id, "weapon_knife");
        switch (cs_get_user_team(id, 0))
        {
            case 1:
            {
                prisonnier(id);
            }
            case 2:
            {
                gardien(id);
            }
            default:
            {
            }
        }
    }
    return 0;
}

public gardien(id)
{
    new menu = menu_create("[Alias#`KraZy] Choisis ta classe de Garde", "gardien_menu", 0);
    menu_additem(menu, "\wMilitaire \y- \w[ \rM4 \w+ \rDeagle \w]", "1", 0, -1);
    menu_additem(menu, "\wSniper \y- \w[ \rAwp \w+ \rDeagle \w]", "2", 0, -1);
    menu_additem(menu, "\wRambo \y- \w[ \rMitrailleuse \w+ \rUsp \w+ \r30HP \w]", "3", 0, -1);
    menu_additem(menu, "\wGarde \y- \w[ \rAk47 \w+ \rDeagle \w]", "4", 0, -1);
    menu_additem(menu, "\wPyro \y- \w[ \rAug \w+ \rDeagle \w] *NEW*", "5", 0, -1);
    menu_setprop(menu, 4, "Quitter");
    menu_setprop(menu, 6, 1);
    menu_display(id, menu, 0);
    return 0;
}

public prisonnier(id)
{
    new menu = menu_create("[Alias#`KraZy] Choisis ta classe de Prisonnier", "prisonnier_menu", 0);
    menu_additem(menu, "\wAssassin \y- \w[ \rGravite \w]", "1", 0, -1);
    menu_additem(menu, "\wDealer \y- \w[ \r130Hp \w]", "2", 0, -1);
    menu_additem(menu, "\wPedobear \y- \w[ \rVitesse \w]", "3", 0, -1);
    menu_additem(menu, "\wTerroriste \y- \w[ \rHe \w+ \rFlash \w+ \rSmoke \w]", "4", 0, -1);
    menu_additem(menu, "\wProtecteur \y- \w[ \rArmure \w+ \rSmoke \w] *NEW*", "5", 0, -1);
    menu_setprop(menu, 4, "Quitter");
    menu_setprop(menu, 6, 1);
    menu_display(id, menu, 0);
    return 0;
}

public gardien_menu(id, menu, item)
{
    !!! Removed Phi
    if (item == -3)
    {
        menu_destroy(menu);
        return 1;
    }
    if (is_user_alive(id) && cs_get_user_team(id, 0) == 2)
    {
        strip_user_weapons(id);
        new key = str_to_num(info);
        switch (key)
        {
            case 1:
            {
                give_item(id, "weapon_knife");
                give_item(id, "weapon_m4a1");
                cs_set_user_bpammo(id, CSW_M4A1, 9000);
                give_item(id, "weapon_deagle");
                cs_set_user_bpammo(id, CSW_DEAGLE, 3500);
                cs_set_user_armor(id, 100, CS_ARMOR_VESTHELM);
            }
            case 2:
            {
                give_item(id, "weapon_knife");
                give_item(id, "weapon_awp");
                cs_set_user_bpammo(id, CSW_AWP, 9000);
                give_item(id, "weapon_deagle");
                cs_set_user_bpammo(id, CSW_DEAGLE, 3500);
                cs_set_user_armor(id, 100, CS_ARMOR_VESTHELM);
            }
            case 3:
            {
                give_item(id, "weapon_knife");
                give_item(id, "weapon_m249");
                cs_set_user_bpammo(id, CSW_M249, 9000);
                give_item(id, "weapon_usp");
                cs_set_user_bpammo(id, CSW_USP, 3500);
                set_user_health(id, get_user_health(id) + 30);
            }
            case 4:
            {
                give_item(id, "weapon_knife");
                give_item(id, "weapon_ak47");
                cs_set_user_bpammo(id, CSW_AK47, 9000);
                give_item(id, "weapon_deagle");
                cs_set_user_bpammo(id, CSW_DEAGLE, 3500);
                cs_set_user_armor(id, 100, CS_ARMOR_VESTHELM);
            }
            case 5:
            {
                give_item(id, "weapon_knife");
                give_item(id, "weapon_aug");
                cs_set_user_bpammo(id, CSW_AUG, 9000);
                give_item(id, "weapon_deagle");
                cs_set_user_bpammo(id, CSW_DEAGLE, 3500);
                cs_set_user_armor(id, 100, CS_ARMOR_VESTHELM);
            }
            default:
            {
            }
        }
    }
    return 0;
}

public prisonnier_menu(id, menu, item)
{
    !!! Removed Phi
    if (item == -3)
    {
        menu_destroy(menu);
        return 1;
    }
    if (is_user_alive(id) && cs_get_user_team(id, 0) == 1)
    {
        new key = str_to_num(info);
        switch (key)
        {
            case 1:
            {
                set_user_gravity(id, 0.40);
            }
            case 2:
            {
                set_user_health(id, get_user_health(id) + 30);
            }
            case 3:
            {
                set_user_maxspeed(id, get_pcvar_float(g_PlayersSpeed));
            }
            case 4:
            {
                give_item(id, "weapon_hegrenade");
                give_item(id, "weapon_flashbang");
                give_item(id, "weapon_smokegrenade");
            }
            case 5:
            {
                give_item(id, "weapon_smokegrenade");
                cs_set_user_armor(id, 100, CS_ARMOR_VESTHELM);
            }
            default:
            {
            }
        }
    }
    return 0;
}


iceeedr 02-09-2019 09:41

Re: error on a plugin for class menu
 
When you tell the truth someone will help you, this is a "sma" from which you tried to unscram the amxx, no friend gave you anything!

CrazY. 02-09-2019 14:44

Re: error on a plugin for class menu
 
This code looks result of a decompiled plugin.

MrGarfield 02-10-2019 05:04

Re: error on a plugin for class menu
 
iceeedr I'm not a liar I can give you the name and his steam ID if you want to prove that I do not tell you salads he was in a team and responsible for a server jail so far we opened a jail together because the team was closed since 2012 and he is part of my community, I have no knowledge in plugin he really passed me plugins and many others

eat1k 02-10-2019 05:26

Re: error on a plugin for class menu
 
It's code from a decompiled plugin, lol.

MrGarfield 02-10-2019 06:13

Re: error on a plugin for class menu
 
if the plugin was already extracted, I'm sorry, but as we have already passed, the plugin, now and possible to reformulate it on demand after a little research on the net I found it

http://i52.tinypic.com/29wl9b6.jpg

And it's possible to have the same choice in the menu style in the plugin I gave thanks

thEsp 02-10-2019 07:45

Re: error on a plugin for class menu
 
Quote:

Originally Posted by MrGarfield (Post 2638837)
hello a friend passed me this

Most common thing in coding forums...
This is longdead.

OciXCrom 02-10-2019 08:08

Re: error on a plugin for class menu
 
1. The code you provided is not a .sma file, it's a decompiled plugin and won't compile without it being transformed into an actual "readable" code.
2. This is the scripting section and here you SCRIPT yourself, you don't wait for someone else to do the work for you. If you want the second thing, post in the REQUESTS section.

MrGarfield 02-10-2019 12:16

Re: error on a plugin for class menu
 
merci pour le conseil, je voudrais savoir comment reconnaitre un amxx decompiler d'un code sma pour que cette action ne se renouvelle pas merci encore

CrazY. 02-10-2019 12:26

Re: error on a plugin for class menu
 
This forum is english only.


All times are GMT -4. The time now is 07:31.

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