Skocz do zawartości

Witamy w Nieoficjalnym polskim support'cie AMX Mod X

Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.
  • Rozpoczynaj nowe tematy i odpowiedaj na inne
  • Zapisz się do tematów i for, aby otrzymywać automatyczne uaktualnienia
  • Dodawaj wydarzenia do kalendarza społecznościowego
  • Stwórz swój własny profil i zdobywaj nowych znajomych
  • Zdobywaj nowe doświadczenia

Dołączona grafika Dołączona grafika

Guest Message by DevFuse
 

Zdjęcie
Inny

[JailBreak] [Sklep V.I.P] - 2 errory

inny

  • Nie możesz napisać tematu
  • Zaloguj się, aby dodać odpowiedź
1 odpowiedź w tym temacie

#1 Dragon1020

    Pomocny

  • Użytkownik

Reputacja: 2
Nowy

  • Postów:50
  • Lokalizacja:Polska
Offline

Napisano 22.01.2014 18:22

A więc, dopisałem do sklepu w buty nike zamiast normalnego speedu to sprint oraz w vipie jest możliwość kupna deagla z 3 ammo a zwykły grasz może z 1 ammo

Oto Plugin:

#include <amxmodx>
#include <amxmisc>
#include <colorchat>
#include <hamsandwich>
#include <cstrike>
#include <fun>
#include <fakemeta>
#include <engine>
#pragma tabsize 0

#define PLUGIN "Mini Shop JailBreak"
#define VERSION "1.4"
#define AUTHOR "Emil29"
#define LEET 1337

new CT_Skins[4][] = {"klawisz_cypis","klawisz_cypis","klawisz_cypis","klawisz_cypis"};

new Terro_Skins[4][] = {"wiezien_cypis","wiezien_cypis","wiezien_cypis","wiezien_cypis"};

new name [32];
new bool:weapon_id;

const g_iProg         = (0xFF);
const g_iWeaps        = (0x1E);
const g_iMaxSpeed    = (0x2EE);
const g_iMaxCzas    = (0xA);

new g_iMaxPlayers;

new Float:g_fTempMaxSpeed[0x21];
new Float:g_fSprintLeft[0x21];

new const Float:g_fWeaponsSpeed[g_iWeaps + 1]={ //THX 4 DARKGL ZA TABLICE ;)
    000.0,
    250.0, 000.0, 260.0, 250.0, 240.0,
    250.0, 250.0, 240.0, 250.0, 250.0,                
    250.0, 250.0, 210.0, 240.0, 240.0,    
    250.0, 250.0, 210.0, 250.0, 220.0,              
    230.0, 230.0, 250.0, 210.0, 250.0,            
    250.0, 235.0, 221.0, 250.0, 245.0
};

public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR)
    register_clcmd("say /jbshop", "jbshop")
    register_clcmd("say /shop", "jbshop")
    register_clcmd("say /sklep", "jbshop")
    register_forward(FM_CmdStart, "fwCmdStart", 0);
    register_event( "CurWeapon", "Event_Change_Weapon", "be", "1=1" );
    RegisterHam(Ham_Spawn, "player", "Fwd_PlayerSpawn_Post", 1)
    set_task(0.4, "taskPrintAmmount", _, _, _, "b");
    g_iMaxPlayers = get_maxplayers();
}
public jbshop(id){
    if(is_user_connected(id) && cs_get_user_team(id) == CS_TEAM_T)
    {
        new menu = menu_create("\Sklep JailBreak","menu")
        menu_additem(menu,"\yMiekkie Kapcie \d[8000$]","1",0)
        menu_additem(menu,"\yButy Nike \d[9000$]","2",0)
        menu_additem(menu,"\yButy Skoczka \d[10000$]","3",0)
        menu_additem(menu,"\yDeagle \d[14000$]","4",0)
            
        menu_additem(menu,"\yHE \d[8000$]","5",0)
            if(get_user_flags(id) & ADMIN_LEVEL_H)
                menu_additem(menu,"\yNiesmiertelnosc na 5 sekund \d[16000$]","6",0)
            if(get_user_flags(id) & ADMIN_LEVEL_H)    
                menu_additem(menu,"\yNiewidzialnosc na 20 sekund \d[16000$]","7",0)
            if(get_user_flags(id) & ADMIN_LEVEL_H)    
                menu_additem(menu,"\yUbranie Ct na 30 sekund \d[10000$]","8",0)
            if(get_user_flags(id) & ADMIN_LEVEL_H)    
                menu_additem(menu,"\yOnly head na 20 sekund \d[16000$]","9",0)
            if(get_user_flags(id) & ADMIN_LEVEL_H)    
                menu_additem(menu,"\yTarcza \d[10000$]","10",0)
        menu_additem(menu,"\yArmorr \d[2000$]","11",0)
        menu_additem(menu,"\yDodatkowe Hp \d[5000$]","12",0)
        
        menu_setprop(menu,MPROP_EXIT,MEXIT_ALL)
        menu_display(id,menu,0)
    }
}
public menu(id, menu, item){
    if(item==MENU_EXIT)
    {
        menu_destroy(menu)
        return PLUGIN_HANDLED;
    }
    new data[6], iName[64]
    new access, callback
    menu_item_getinfo(menu, item, access, data,5, iName, 63, callback)
    new key = str_to_num(data)
    
    switch(key)
    {
        case 1 :{
            if (cs_get_user_money(id) < 8000){
                get_user_name(id, name, 31)
                ColorChat(id, GREEN, "%s ^x03Nie masz wystarczajaca hajsu!", name)
                return PLUGIN_HANDLED;
            }
            if (!is_user_alive(id)){
                get_user_name(id, name, 31)
                ColorChat(id, BLUE, "%s ^x03Tylko zywi moga kupowac!", name)
                return PLUGIN_HANDLED;
            }
            if (cs_get_user_money(id) >= 8000 ){
                get_user_name(id, name, 31)  
                set_user_footsteps( id, 1)
                ColorChat(0, RED, "Kupiono Miekkie Kapcie, dzięki ktorym nie slychac twoich krokow.", name)
                cs_set_user_money(id , cs_get_user_money(id) - 8000, 0)
            }
        }
        case 2 :{
            if (cs_get_user_money(id) < 9000){
                get_user_name(id, name, 31)
                ColorChat(id, GREEN, "%s ^x03Nie masz wystarczajaca hajsu!", name)
                return PLUGIN_HANDLED;
            }
            if (!is_user_alive(id)){
                get_user_name(id, name, 31)
                ColorChat(id, BLUE, "%s ^x03Tylko zywi moga kupowac!", name)
                return PLUGIN_HANDLED;
            }
            if (cs_get_user_money(id) >= 9000 ){
                get_user_name(id, name, 31)
                ColorChat(0, RED, "Kupiono Buty Nike, dzięki ktorym mozesz szybciej biegac.", name)
                g_fSprintLeft[id] -= 0.05;
                cs_set_user_money(id , cs_get_user_money(id) - 9000, 0)
            }
        }
        case 3 : {
            if (cs_get_user_money(id) < 10000){
                get_user_name(id, name, 31)
                ColorChat(id, GREEN, "%s ^x03Nie masz wystarczajaca hajsu!", name)
                return PLUGIN_HANDLED;
            }
            if (!is_user_alive(id)){
                get_user_name(id, name, 31)
                ColorChat(id, BLUE, "%s ^x03Tylko zywi moga kupowac!", name)
                return PLUGIN_HANDLED;
            }
            if (cs_get_user_money(id) >= 10000 ){
                get_user_name(id, name, 31)
                ColorChat(0, RED, "Kupiono Buty Skoczka, dzięki ktorym mozesz wyzej skakac.", name)
                set_user_gravity(id, 0.5)
                cs_set_user_money(id , cs_get_user_money(id) - 10000, 0)
            }
            
        }
        case 4 : {
            if (cs_get_user_money(id) < 14000){
                get_user_name(id, name, 31)
                ColorChat(id, GREEN, "%s ^x03Nie masz wystarczajaca hajsu!", name)
                return PLUGIN_HANDLED;
            }
            if (!is_user_alive(id)){
                get_user_name(id, name, 31)
                ColorChat(id, BLUE, "%s ^x03Tylko zywi moga kupowac!", name)
                return PLUGIN_HANDLED;
            }
            if (cs_get_user_money(id) >= 14000 ){
                get_user_name(id, name, 31)
                ColorChat(0, RED, "Kupiono Deagle z 1 ammo", name)
                give_item(id, "weapon_deagle");
                give_item(id, "ammo_50ae");
                weapon_id=find_ent_by_owner(-1, "weapon_deagle", id);
                if(weapon_id)cs_set_weapon_ammo(weapon_id, 1);
                    if(get_user_flags(id) & ADMIN_LEVEL_H)
                    if(weapon_id)cs_set_weapon_ammo(weapon_id, 3);
                cs_set_user_bpammo(id, CSW_DEAGLE, 0);    
                cs_set_user_money(id , cs_get_user_money(id) - 14000, 0)
            }

            
        }
        case 5 :{
            if (cs_get_user_money(id) < 8000){
                get_user_name(id, name, 31)
                ColorChat(id, GREEN, "%s ^x03Nie masz wystarczajaca hajsu!", name)
                return PLUGIN_HANDLED;
            }
            if (!is_user_alive(id)){
                get_user_name(id, name, 31)
                ColorChat(id, BLUE, "%s ^x03Tylko zywi moga kupowac!", name)
                return PLUGIN_HANDLED;
            }
            if (cs_get_user_money(id) >= 8000 ){
                get_user_name(id, name, 31)
                ColorChat(0, RED, "Kupiono HE", name)
                give_item(id, "weapon_hegrenade");
                cs_set_user_money(id , cs_get_user_money(id) - 8000, 0)
            }
            
        }
        case 6 :{
            if (cs_get_user_money(id) < 16000){
                get_user_name(id, name, 31)
                ColorChat(id, GREEN, "%s ^x03Nie masz wystarczajaca hajsu!", name)
                return PLUGIN_HANDLED;
            }
            if (!is_user_alive(id)){
                get_user_name(id, name, 31)
                ColorChat(id, BLUE, "%s ^x03Tylko zywi moga kupowac!", name)
                return PLUGIN_HANDLED;
            }
            if (cs_get_user_money(id) >= 16000 ){
                get_user_name(id, name, 31)
                ColorChat(0, RED, "Kupiono Niesmiertelnosc na 5 sekund", name)
                set_user_godmode(id, 1)
                set_task(5.0, "godoff", id)
                cs_set_user_money(id , cs_get_user_money(id) - 16000, 0)
            }
            
        }
        
        case 7 :{
            if (cs_get_user_money(id) < 16000){
                get_user_name(id, name, 31)
                ColorChat(id, GREEN, "%s ^x03Nie masz wystarczajaca hajsu!", name)
                return PLUGIN_HANDLED;
            }
            if (!is_user_alive(id)){
                get_user_name(id, name, 31)
                ColorChat(id, BLUE, "%s ^x03Tylko zywi moga kupowac!", name)
                return PLUGIN_HANDLED;
            }
            if (cs_get_user_money(id) >= 16000 ){
                get_user_name(id, name, 31)
                ColorChat(0, RED, "Kupiono Niewidzialnosc na 20 sekund", name)
                set_user_rendering(id, kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 30)
                set_task(20.0, "kRenderTransAlphaoff", id)
                cs_set_user_money(id , cs_get_user_money(id) - 17000, 0)
            }
            
        }
        case 8 :{
            if (cs_get_user_money(id) < 10000){
                get_user_name(id, name, 31)
                ColorChat(id, GREEN, "%s ^x03Nie masz wystarczajaca hajsu!", name)
                return PLUGIN_HANDLED;
            }
            if (!is_user_alive(id)){
                get_user_name(id, name, 31)
                ColorChat(id, BLUE, "%s ^x03Tylko zywi moga kupowac!", name)
                return PLUGIN_HANDLED;
            }
            if (cs_get_user_money(id) >= 10000 ){
                get_user_name(id, name, 31)
                ColorChat(0, RED, "Kupiono Ubranie Ct na 30 sekund", name)
                ZmienUbranie(id, 0);
                set_task(30.0, "ubranie", id)
                cs_set_user_money(id , cs_get_user_money(id) - 10000, 0)
            }
            
        }
        case 9 :{
            if (cs_get_user_money(id) < 16000){
                get_user_name(id, name, 31)
                ColorChat(id, GREEN, "%s ^x03Nie masz wystarczajaca hajsu!", name)
                return PLUGIN_HANDLED;
            }
            if (!is_user_alive(id)){
                get_user_name(id, name, 31)
                ColorChat(id, BLUE, "%s ^x03Tylko zywi moga kupowac!", name)
                return PLUGIN_HANDLED;
            }
            if (cs_get_user_money(id) >= 16000 ){
                get_user_name(id, name, 31)
                ColorChat(0, RED, "Kupiono Only head ", name)
                set_user_hitzones (0, id, 2)
                set_task(20.0, "hit", id)
                cs_set_user_money(id , cs_get_user_money(id) - 20000, 0)
            }
            
        }
        case 10 :{
            if (cs_get_user_money(id) < 10000){
                get_user_name(id, name, 31)
                ColorChat(id, GREEN, "%s ^x03Nie masz wystarczajaca hajsu!", name)
                return PLUGIN_HANDLED;
            }
            if (!is_user_alive(id)){
                get_user_name(id, name, 31)
                ColorChat(id, BLUE, "%s ^x03Tylko zywi moga kupowac!", name)
                return PLUGIN_HANDLED;
            }
            if (cs_get_user_money(id) >= 10000 ){
                get_user_name(id, name, 31)
                ColorChat(0, RED, "Kupiono Tarcze ", name)
                give_item(id, "weapon_shield")
                cs_set_user_money(id , cs_get_user_money(id) - 10000, 0)
            }
            
        }
        case 11 :{
            if (cs_get_user_money(id) < 2000){
                get_user_name(id, name, 31)
                ColorChat(id, GREEN, "%s ^x03Nie masz wystarczajaca hajsu!", name)
                return PLUGIN_HANDLED;
            }
            if (!is_user_alive(id)){
                get_user_name(id, name, 31)
                ColorChat(id, BLUE, "%s ^x03Tylko zywi moga kupowac!", name)
                return PLUGIN_HANDLED;
            }
            if (cs_get_user_money(id) >= 2000 ){
                get_user_name(id, name, 31)
                ColorChat(0, RED, "Kupiono Armorr ", name)
                set_user_armor(id, 100)    
                cs_set_user_money(id , cs_get_user_money(id) - 2000, 0)
            }
            
        }
        case 12 :{
            if (cs_get_user_money(id) < 5000){
                get_user_name(id, name, 31)
                ColorChat(id, GREEN, "%s ^x03Nie masz wystarczajaca hajsu!", name)
                return PLUGIN_HANDLED;
            }
            if (!is_user_alive(id)){
                get_user_name(id, name, 31)
                ColorChat(id, BLUE, "%s ^x03Tylko zywi moga kupowac!", name)
                return PLUGIN_HANDLED;
            }
            if (cs_get_user_money(id) >= 5000 ){
                get_user_name(id, name, 31)
                ColorChat(0, RED, "Kupiono Dodatkowe Hp ", name)
                set_user_health(id, get_user_health(id) + 20)
                    if(get_user_flags(id) & ADMIN_LEVEL_H)
                    set_user_health(id, get_user_health(id) + 35)
                cs_set_user_money(id , cs_get_user_money(id) - 5000, 0)
            }
            
        }     
    }
    return PLUGIN_HANDLED;
}
public plugin_cfg() set_cvar_num("sv_maxspeed", g_iMaxSpeed);

public Event_Change_Weapon(id){
    if(g_fTempMaxSpeed[id] >= float(g_iProg)){
        set_pev(id, pev_maxspeed, g_fTempMaxSpeed[id]);
        client_cmd(id, "cl_forwardspeed ^"%d^"", floatround(g_fTempMaxSpeed[id]));
        
        #if defined DEBUG
        client_print(id, 3, "%.1f", g_fTempMaxSpeed[id]);
        #endif
    }
    else{
        set_pev(id, pev_maxspeed, g_fWeaponsSpeed[get_user_weapon(id)]);
        
        #if defined DEBUG
        client_print(id, 3, "%.1f", g_fWeaponsSpeed[get_user_weapon(id)]);
        #endif
    }
}

public fwCmdStart(id, iHandle, iSeed){
    if(!is_user_alive(id)) return FMRES_IGNORED;
    
    new Float:fmove, Float:smove;
    get_uc(iHandle, UC_ForwardMove, fmove);
    get_uc(iHandle, UC_SideMove, smove);
    
    new Float:maxspeed;
    pev(id, pev_maxspeed, maxspeed);
    new Float:walkspeed = (maxspeed * 0.52);
    fmove = floatabs(fmove);
    smove = floatabs(smove);
    
    if(fmove <= walkspeed && smove <= walkspeed && !(fmove == 0.0 && smove == 0.0)){    
        if(g_fSprintLeft[id] >= 0.5){
            if(task_exists(id + LEET)) remove_task(id + LEET);
            g_fTempMaxSpeed[id] = g_fTempMaxSpeed[id] < 400.0 ? 400.0 : g_fTempMaxSpeed[id];
            g_fTempMaxSpeed[id] = g_fTempMaxSpeed[id] < float(g_iMaxSpeed) ? g_fTempMaxSpeed[id] + 10.0 : g_fTempMaxSpeed[id];
            set_pev(id, pev_maxspeed, g_fTempMaxSpeed[id]);
            client_cmd(id, "cl_forwardspeed ^"%d^"", floatround(g_fTempMaxSpeed[id]));
            engclient_cmd(id, "weapon_knife");
            
            g_fSprintLeft[id] -= 0.05;
            
            for(new i = 0 ; i < 0x10 ; i++){
                new bitButtons         = get_uc(iHandle, UC_Buttons);
                new bitOldbuttons     = pev(id, pev_oldbuttons);
                if(!(((1<<3)|(1<<4)|(1<<12)) & (1<<i))){
                    if((bitButtons & (1<<i))){
                        if((1<<2) & (1<<i))
                            set_pev(id, pev_oldbuttons, bitOldbuttons | (1<<i));
                        
                        else
                            set_uc(iHandle, UC_Buttons, bitButtons & (~(1<<i)));
                        
                        return FMRES_SUPERCEDE;
                    }
                }
            }
        }
        else{
            g_fTempMaxSpeed[id] = 0.0;
            Event_Change_Weapon(id);
            client_print(id, print_center, "Odpocznij chwile!");
        }
        return FMRES_IGNORED;
    }
    else{
        if(!task_exists(id + LEET)) set_task(1.0, "taskRecoverSprint", id + LEET);
        g_fTempMaxSpeed[id] = 0.0;
        Event_Change_Weapon(id);
    }
    return FMRES_IGNORED;
}

public taskRecoverSprint(task_id){
    new id = task_id - LEET;
    
    g_fSprintLeft[id]++;
    
    if(floatround(g_fSprintLeft[id]) < g_iMaxCzas || floatround(g_fSprintLeft[id]) > g_iMaxCzas){
        if(floatround(g_fSprintLeft[id]) < g_iMaxCzas) set_task(1.0, "taskRecoverSprint", id + LEET);
        if(floatround(g_fSprintLeft[id]) > g_iMaxCzas) g_fSprintLeft[id] = float(g_iMaxCzas);
    }
}

public taskPrintAmmount(){
    static id; //statyczna
    for(id = 1 ; id <= g_iMaxPlayers ; id++){
        if(is_user_alive(id)){
            new iSprint = floatround(g_fSprintLeft[id]);
            new sSprint[g_iMaxCzas];
            
            while(iSprint >= 1){
                iSprint--;
                add(sSprint, sizeof sSprint - 1, "*");
            }
            iSprint = floatround(g_fSprintLeft[id]);
            set_hudmessage(iSprint ? 0x64 : 0xFF, iSprint ? 0x48 : 0x0, iSprint ? 0xC : 0x0, 0.01, 0.77, 0, 0.000001, 0.405, 0.000001, 0.000001, -1);
            show_hudmessage(id, "SPRINT : [%s]", sSprint);    
        }
    }
}
public Fwd_PlayerSpawn_Post(id){
    if (is_user_alive(id)){
        if(!g_fSprintLeft[id]){
            g_fSprintLeft[id] = 0;
        }
        set_user_footsteps(id, 0)
    }
}
public ZmienUbranie(id,reset)

{

if (!is_user_connected(id))

return PLUGIN_CONTINUE;



if (reset)

cs_reset_user_model(id);

else

{

new num = random_num(0,3);

cs_set_user_model(id, (get_user_team(id) == 1)? CT_Skins[num]: Terro_Skins[num]);

}



return PLUGIN_CONTINUE;

}

public godoff(id)
{
     set_user_godmode(id, 0);
}
public kRenderTransAlphaoff(id)
{
set_user_rendering(id, kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 255)
}

public ubranie(id)
{
     ZmienUbranie(id, 1);
}
public hit(id)
{
     set_user_hitzones (0, id, 255)
}

A oto jakie są errory:


Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team

abc.sma(177) : warning 213: tag mismatch
abc.sma(455) : warning 213: tag mismatch
Header size:           2092 bytes
Code size:            19724 bytes
Data size:             9232 bytes
Stack/heap size:      16384 bytes; max. usage is unknown, due to recursion
Total requirements:   47432 bytes

2 Warnings.
Done.

Niestety nie umiem sobie poradzić z tymi errorami, jeśli by mógł ktoś pomóc to będę wdzięczny i rzecz jasna osoba ta zostanie nagrodzona "karmą"


  • +
  • -
  • 0

#2 Dragon1020

    Pomocny

  • Autor tematu
  • Użytkownik

Reputacja: 2
Nowy

  • Postów:50
  • Lokalizacja:Polska
Offline

Napisano 22.01.2014 18:40

Znalazłem kolejny bug a mianowicie podczas gry każdy ma jakby ten sprint na dole HUD'u i może go używać bez zakupu Buty Nike,

Umiałby to ktoś poprawić żeby:

Sprint miały osoby które kupiły te Buty (tylko dla TT)

Ilość Użyć Sprintu: 5 (5x nacisnie SHIFT i się konczy bo jak się nacisnie SHIFT raz to nie sprintuje tylko trzeba przytrzymać a wtedy i tak regeneruje się pasek - żeby było po prostu 5x użyty SHIFT)


  • +
  • -
  • 0





Również z jednym lub większą ilością słów kluczowych: inny

Użytkownicy przeglądający ten temat: 0

0 użytkowników, 0 gości, 0 anonimowych