Raised This Month: $12 Target: $400
 3% 

[Ayuda] Godmode hns


  
 
 
Thread Tools Display Modes
Author Message
cogu123
Junior Member
Join Date: Oct 2012
Old 11-28-2012 , 10:50   [Ayuda] Godmode hns
#1

Buenas, tengo un problema, tengo este plugin para comprar godmode, funciona todo bien vale $16000, pero al comprarlo no se descuenta el dinero te quedas con los $16000.
Ayuda.

PHP Code:
#include <amxmodx>
#include <cstrike>
#include <fun>

new OnOffprecio1
new unavez[33]

public 
plugin_init() {
    
    
register_plugin("PLUGIN""VERSION""AUTHOR")
    
register_clcmd("say /godmode""ShopMio")
    
register_clcmd("say_team /godmode""ShopMio")
    
    
OnOff register_cvar("jb_tienda""1")
    
    
register_event("HLTV""start_round""a""1=0""2=0")
    
    
precio1 register_cvar("jb_pGodMode""16000")
}
public 
start_round()
{
    for (new 
id 1id <= get_maxplayers(); id++)
    {
        
unavez[id] = 0
    
}
}

public 
client_putinserver(id)
{
    
unavez[id] = 0
}

public 
ShopMio(id)
{
    if(
get_pcvar_num(OnOff) == 1)
    {
        if(
unavez[id] == 0)
        {
            if(
is_user_alive(id))
            {
                new 
Menu menu_create("\rGODMODE \y[Owners] :""Handlehns")
                
                
menu_additem(Menu"\wGodMode \r(10 Segundos) \[$16000]","1"0)
                
                
menu_display(idMenu0)
            }
            else
            {
                
client_print(idprint_chat"[Godmode] Estas Muerto No Puedes Comprar Godmode!")
            }
        }
        else if(
unavez[id] >= 1)
            
client_print(idprint_chat"[Godmode] Solo puedes comprar una sola vez Godmode por ronda")
    }
    else if(
get_pcvar_num(OnOff) == 0)
    {
        
client_print(idprint_chat"[Godmode] La Tienda Esta Desactivada")
    }
}  
public 
Handlehns(idMenuitem)
{
    if (
item == MENU_EXITmenu_destroy(Menu)
    
    new 
data[6],iAccess,iCallback,iName[64];
    
    new 
money cs_get_user_money(id)
    
    
menu_item_getinfo(MenuitemiAccessdata5iName63iCallback)
    
    switch (
str_to_num(data))
    {
        case 
1
        {
            if(
money >= get_pcvar_num(precio1))
            {
                
set_user_godmode(id1)
                
client_print(idprint_chat"[Godmode] Compraste 10 segundos de godmode")
                
set_task(10.0,"sacargodmode"id)
                
unavez[id]++
            }
            else
                
client_print(idprint_chat"[Godmode] Debes tener $%i para comprar 10 segundos de godmode",get_pcvar_num(precio1))
        }
    }
    return 
PLUGIN_HANDLED
}  

public 
sacargodmode(id)
{
    
set_user_godmode(id0)
    
client_print(idprint_chat"[Godmode] Se te acabo el godmode")

cogu123 is offline
BlackFur
BANNED
Join Date: Apr 2012
Location: RCL
Old 11-28-2012 , 10:58   Re: [Ayuda] Godmode hns
#2

PHP Code:
#include <amxmodx> 
#include <cstrike> 
#include <fun> 

new OnOffprecio1 
new unavez[33
new 
imax

public plugin_init() { 
    
    
register_plugin("PLUGIN""VERSION""AUTHOR"
    
register_clcmd("say /godmode""ShopMio"
    
register_clcmd("say_team /godmode""ShopMio"
    
    
OnOff register_cvar("jb_tienda""1"
    
    
register_event("HLTV""start_round""a""1=0""2=0"
    
    
precio1 register_cvar("jb_pGodMode""16000"
    
    
imax get_maxplayers()

public 
start_round() 

    for (new 
id 1id <= imax id++) 
    { 
        
unavez[id] = 
    



public 
client_putinserver(id

    
unavez[id] = 0
    set_user_godmode
(id 0)


public 
ShopMio(id

    if(
get_pcvar_num(OnOff)) 
    { 
        if(!
unavez[id]) 
        { 
            if(
is_user_alive(id)) 
            { 
                new 
Menu menu_create("\rGODMODE \y[Owners] :""Handlehns"
                
                new 
len[99]
                
                
formatex(len 98 "\wGodmode \r(10 Segundos) \w[%d]" get_pcvar_num(precio1))
                
                
menu_additem(Menulen ,"1"0
                
                
menu_display(idMenu0
            } 
            else 
            { 
                
client_print(idprint_chat"[Godmode] Estas Muerto No Puedes Comprar Godmode!"
            } 
        } 
        else if(
unavez[id]) 
            
client_print(idprint_chat"[Godmode] Solo puedes comprar una sola vez Godmode por ronda"
    } 
    else
        
client_print(idprint_chat"[Godmode] La Tienda Esta Desactivada"
}   

public 
Handlehns(idMenuitem

    if (
item == MENU_EXIT || !is_user_alive(id))
        return 
PLUGIN_HANDLED
    
    
new money cs_get_user_money(id
    new 
costo get_pcvar_num(precio1)
    
    if(
money >= costo)
    {
        
set_user_godmode(id1
        
client_print(idprint_chat"[Godmode] Compraste 10 segundos de godmode"
        
set_task(10.0,"sacargodmode"id
        
unavez[id]++
        
cs_set_user_money(id money costo)
    }
    else
        
client_print(id print_chat "[Godmode] Necesitas $ %d para comprar esto" costo)
    
    return 
PLUGIN_HANDLED 
}   

public 
sacargodmode(id

    
set_user_godmode(id0
    
client_print(idprint_chat"[Godmode] Se te acabo el godmode"


Last edited by BlackFur; 11-28-2012 at 11:03.
BlackFur is offline
xGreat
Senior Member
Join Date: Jul 2012
Location: Chilean
Old 11-29-2012 , 18:31   Re: [Ayuda] Godmode hns
#3

Looool

PHP Code:
new unavez[33]

register_event("HLTV""start_round""a""1=0""2=0")

public 
start_round()  
{  
    for (new 
id 1id <= imax id++)  
    {  
        
unavez[id] = 0  
    
}  

Mejor usa :

PHP Code:
RegisterHam(Ham_Spawn"player""Spawn"1)

public 
Spawn(id)
{
    
g_Usado[id] = false

Eso , Saludos xGreat
__________________
Mi 255
WwW.HnsBJz.Tk = MI FORO

xGreat is offline
Send a message via MSN to xGreat
BlackFur
BANNED
Join Date: Apr 2012
Location: RCL
Old 11-29-2012 , 20:07   Re: [Ayuda] Godmode hns
#4

Quote:
Originally Posted by xGreat View Post
Looool

PHP Code:
new unavez[33]

register_event("HLTV""start_round""a""1=0""2=0")

public 
start_round()  
{  
    for (new 
id 1id <= imax id++)  
    {  
        
unavez[id] = 0  
    
}  

Mejor usa :

PHP Code:
RegisterHam(Ham_Spawn"player""Spawn"1)

public 
Spawn(id)
{
    
g_Usado[id] = false

Eso , Saludos xGreat
Es JailBreak No DeathMatch ¬¬!
BlackFur 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 17:04.


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