Raised This Month: $ Target: $400
 0% 

I have probles whit this shop in set_user_maxspeed :S!


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
kikifrh
Senior Member
Join Date: May 2009
Old 12-28-2009 , 19:07   Re: I have probles whit this shop in set_user_maxspeed :S!
Reply With Quote #4

I'm not good on script, I know somethings, I'll try to fix, but if someone post here other code, I suggest you to use it ^_^
Code:
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <cstrike>
#include <fun>
#define PLUGIN "[JB] Tienda"
#define VERSION "2.1"
#define AUTHOR "[M]aNuC[s]_"
new OnOff, precio1, precio2, precio3, precio4, precio5, precio6, precio7
new bool:UnaSola[33] 
new bool:Ronda[33]
new g_iMsgSayText 
new vida
new armor

public plugin_init() 
{
    register_clcmd("say /tienda", "Tienda")
    register_clcmd("say !tienda", "Tienda")
    register_clcmd("say_team /tienda", "Tienda")
    register_clcmd("say_team !tienda", "Tienda")
    RegisterHam(Ham_Spawn, "player", "Fwd_PlayerSpawn_Post", 1)
    
    OnOff = register_cvar("jb_tienda", "1") //1(ON) 0(OFF) 
    precio1 = register_cvar("jb_pFlash", "2000")
    precio2    = register_cvar("jb_pHe", "3000")
    precio3    = register_cvar("jb_pHEFL", "6000")
    precio4    = register_cvar("jb_pSilencio", "8000")
    precio5    = register_cvar("jb_pRapido", "10000")
    precio6    = register_cvar("jb_pDrogas", "12000")
    precio7    = register_cvar("jb_pGlock", "16000")
    vida = register_cvar("jb_dVida", "200")
    armor = register_cvar("jb_dArmor", "200")
    g_iMsgSayText = get_user_msgid("SayText") 
}
public plugin_precache() 
{
  precache_sound("[JB]Tienda/Si.wav")
  precache_sound("[JB]Tienda/No.wav")
  return PLUGIN_CONTINUE
}
public Tienda(id)
{
        if(get_pcvar_num(OnOff) && UnaSola[id] == true)
        {
            if(get_pcvar_num(OnOff) && Ronda[id] == false)
            {
                if(is_user_alive(id))
                {
                    if (cs_get_user_team(id) == CS_TEAM_T )
                    {
                    new contador=0;
                    new players[32], num, tempid;
                    get_players(players, num)
                    for (new i=0; i<num; i++)
                    {
                    tempid = players[i]
        
                    if (get_user_team(tempid)==1 && is_user_alive(tempid))
                    {
                        contador++;
                    }
                    }
                    if ( contador == 1 )
                    {
                        ChatColor(id, "!team[TiendaJB]: !gEres El Ultimo !teamConvicto!g, Usa !team/lr ")
                    }
                    else if ( contador >= 2 )
                    {
                    static Item[64]
    
                    formatex(Item, charsmax(Item),"\w[JB] \rTienda:") 
                    new Menu = menu_create(Item, "TiendaHandler")
    
                    formatex(Item, charsmax(Item),"\wGranada Flash \r%d$", get_pcvar_num(precio1))
                    menu_additem(Menu, Item, "1")
    
                    formatex(Item, charsmax(Item),"\wGranada He \r%d$", get_pcvar_num(precio2))
                    menu_additem(Menu, Item, "2")
    
                    formatex(Item, charsmax(Item),"\wGranada He + Flash \r%d$", get_pcvar_num(precio3))
                    menu_additem(Menu, Item, "3")
    
                    formatex(Item, charsmax(Item),"\wPasos Silenciosos \r%d$", get_pcvar_num(precio4))
                    menu_additem(Menu, Item, "4")
    
                    formatex(Item, charsmax(Item),"\wCorrer Mas Rapido \r%d$", get_pcvar_num(precio5))
                    menu_additem(Menu, Item, "5")
                    
                    formatex(Item, charsmax(Item),"\wDrogarse \r%d$", get_pcvar_num(precio6))
                    menu_additem(Menu, Item, "6")
    
                    formatex(Item, charsmax(Item),"\wGlock \r%d$", get_pcvar_num(precio7))
                    menu_additem(Menu, Item, "7")
    
                    menu_setprop(Menu, MPROP_EXIT, MEXIT_ALL)
                    menu_display(id, Menu)
                    }
                }
                    else
                    {
                    ChatColor(id, "!team[TiendaJB]: !gSolo Los !teamTerroristas !gPueden Comprar")
                    }
                }
                else
                {
                    ChatColor(id, "!team[TiendaJB]: !gEstas Muerto No Puedes Abrir La !teamTienda")
                }
            }
            else
            {
                ChatColor(id, "!team[TiendaJB]: !gSolo Puedes Comprar Una Sola Vez Por Ronda")
            }
        }
        else
        {
        ChatColor(id, "!team[TiendaJB]: !gLa Tienda Esta !teamDesactivada")
        }
}

public TiendaHandler(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 vivo = is_user_alive(id)
    new dinero = cs_get_user_money(id) 
    new gmsg_SetFOV = get_user_msgid("SetFOV") 
    
    new Obtener1 = get_pcvar_num(precio1)
    new Obtener2 = get_pcvar_num(precio2)
    new Obtener3 = get_pcvar_num(precio3)
    new Obtener4 = get_pcvar_num(precio4)
    new Obtener5 = get_pcvar_num(precio5)
    new Obtener6 = get_pcvar_num(precio6)
    new Obtener7 = get_pcvar_num(precio7)
    new vida1 = get_user_health(id)
    new vida2 = get_pcvar_num(vida)
    new armor1 = get_user_armor(id)
    new armor2 = get_pcvar_num(armor)
    new key = str_to_num(data);
    switch(key)
    {
    case 1:
    {
        if (dinero >= Obtener1 && vivo)
            {
            cs_set_user_money(id, dinero - Obtener1)
            ChatColor(id, "!team[TiendaJB]: !gCompraste Una Granada De Flash")
            give_item(id, "weapon_flashbang")
            give_item(id, "weapon_flashbang")
            client_cmd(id,"spk [JB]Tienda/Si")
            Ronda[id] = true
            }
        else
            {
            ChatColor(id, "!team[TiendaJB]: !gNo Tienes Suficiente Dinero")   
            client_cmd(id,"spk [JB]Tienda/No")
            }
    }
    case 2:
    {
        if (dinero >= Obtener2 && vivo)
            {
            cs_set_user_money(id, dinero - Obtener2)
            ChatColor(id, "!team[TiendaJB]: !gCompraste Una Granada He ")
            give_item(id, "weapon_hegrenade")
            client_cmd(id,"spk [JB]Tienda/Si")
            Ronda[id] = true
            }
        else
            {
            ChatColor(id, "!team[TiendaJB]: !gNo Tienes Suficiente Dinero") 
            client_cmd(id,"spk [JB]Tienda/No")
            }
    }
    case 3:
    {
        if (dinero >= Obtener3 && vivo)
            {
            cs_set_user_money(id, dinero - Obtener3)
            ChatColor(id, "!team[TiendaJB]: !gCompraste Una Granada He + Flash")
            give_item(id, "weapon_hegrenade")
            give_item(id, "weapon_flashbang")
            give_item(id, "weapon_flashbang")
            client_cmd(id,"spk [JB]Tienda/Si")
            Ronda[id] = true
            }
        else
            {
            ChatColor(id, "!team[TiendaJB]: !gNo Tienes Suficiente Dinero") 
            client_cmd(id,"spk [JB]Tienda/No")
            }
    }
    case 4:
    {
        if (dinero >= Obtener4 && vivo)
            {
            cs_set_user_money(id, dinero - Obtener4)
            ChatColor(id, "!team[TiendaJB]: !gCompraste Pasos Silenciosos")
            set_user_footsteps(id, 1)
            client_cmd(id,"spk [JB]Tienda/Si")
            Ronda[id] = true
            }
        else
            {
            ChatColor(id, "!team[TiendaJB]: !gNo Tienes Suficiente Dinero") 
            client_cmd(id,"spk [JB]Tienda/No")
            }
    }
    case 5:
    {        
        if (dinero >= Obtener5 && vivo)
            {
            cs_set_user_money(id, dinero - Obtener5)
            ChatColor(id, "!team[TiendaJB]: !gCompraste Velocidad") 
            Speed[id] = 1
            set_user_maxspeed(id, 500.0)
            client_cmd(id,"spk [JB]Tienda/Si")
            Ronda[id] = true
            }
        else
            {
            ChatColor(id, "!team[TiendaJB]: !gNo Tienes Suficiente Dinero")    
            client_cmd(id,"spk [JB]Tienda/No")
            }
    }
    case 6:
    {    
        if (dinero >= Obtener6 && vivo)
            {
            cs_set_user_money(id, dinero - Obtener6)
            ChatColor(id, "!team[TiendaJB]: !gCompraste Drogas") 
            set_user_armor(id, armor1 + armor2)
            set_user_health(id, vida1 + vida2)
            set_user_maxspeed(id, 380.0)
            message_begin( MSG_ONE, gmsg_SetFOV, { 0, 0, 0 }, id )
            write_byte( 180 )
            message_end( )  
            client_cmd(id,"spk [JB]Tienda/Si")
            Ronda[id] = true
            }
        else
            {
            ChatColor(id, "!team[TiendaJB]: !gNo Tienes Suficiente Dinero")   
            client_cmd(id,"spk [JB]Tienda/No")
            }
    }
    case 7:
    {
        if (dinero >= Obtener7 && vivo)
            {
            cs_set_user_money(id, dinero - Obtener7)    
            ChatColor(id, "!team[TiendaJB]: !gCompraste Una Glock") 
            give_item(id, "weapon_glock18")
            cs_set_user_bpammo(id, CSW_GLOCK18, 0)
            client_cmd(id,"spk [JB]Tienda/Si")
            Ronda[id] = true
            }
        else
            {
            ChatColor(id, "!team[TiendaJB]: !gNo Tienes Suficiente Dinero")   
            client_cmd(id,"spk [JB]Tienda/No")
            }
    }
    }
    menu_destroy(menu);
    return PLUGIN_HANDLED;
}  
public Fwd_PlayerSpawn_Post(id)
{
    if (is_user_alive(id))
    {
    set_user_footsteps(id, 0)
    set_user_maxspeed(id, 320.0)
    UnaSola[id] = true
    Ronda[id] = false
    Speed[id] = 0
    }
}

stock ChatColor(const id, const input[], any:...)
{
    new count = 1, players[32]
    static msg[191]
    vformat(msg, 190, input, 3)
    
    replace_all(msg, 190, "!g", "^4") // Green Color
    replace_all(msg, 190, "!y", "^1") // Default Color
    replace_all(msg, 190, "!team", "^3") // Team Color
    replace_all(msg, 190, "!team2", "^0") // Team2 Color
    
    if (id) players[0] = id; else get_players(players, count, "ch")
    {
        for (new i = 0; i < count; i++)
        {
            if (is_user_connected(players[i]))
            {
        message_begin(MSG_ONE_UNRELIABLE, g_iMsgSayText, _, players[i])  
        write_byte(players[i]);
        write_string(msg);
        message_end();
            }
        }
    }
}  

try this, hope it work

Last edited by kikifrh; 12-28-2009 at 19:13.
kikifrh is offline
 



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


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