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

[ZP] Ayuda bubble para HNS (Chequeo de equipos)


  
 
 
Thread Tools Display Modes
Author Message
Usertarget
New Member
Join Date: Jun 2012
Old 06-18-2012 , 01:16   [ZP] Ayuda bubble para HNS (Chequeo de equipos)
#1

Hola , tengo un comando para poder comprar un tipo de granada lo cual quiero restringuir que solo los terroristas puedan acceder a el.

¿Alguna ayuda ?

PHP Code:

public plugin_init()
{
register_plugin(PLUGINVERSIONAUTHOR)

RegisterHam(Ham_Think"grenade""fw_ThinkGrenade")

RegisterHam(Ham_Spawn"player""fw_PlayerSpawn_Post"1)

register_forward(FM_SetModel"fw_SetModel")

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

register_touch(entclas"player""entity_touch")

register_event("CurWeapon""Event_CurWeapon""be","1=1")

g_SayText get_user_msgid("SayText")

register_clcmd("say /granada""clcmd_granada")
}

public 
plugin_natives()
register_native("hns_granada_hielo""native_granada_hielo"1)

public 
native_granada_hielo(id)
g_buy_bomb[id] = true

public clcmd_granada2(id)
{
g_buy_bomb[id] = true
}

public 
clcmd_campo(id)
{
if(!
is_user_alive(id))
return 
PLUGIN_HANDLED;

if(
cs_get_user_money(id) < PRICE)
{
client_print(idprint_chat"[lararararaara] aralralrlara"PRICE)
return 
PLUGIN_HANDLED;
}

g_buy_bomb[id] = true
fm_give_item
(id"weapon_smokegrenade")
cs_set_user_money(idcs_get_user_money(id) - PRICE)

return 
PLUGIN_CONTINUE;

Tengo unos que dicen tambien
PHP Code:
public plugin_precache() { 
que vienen con info adentro

tambien:
PHP Code:
ublic Event_CurWeapon(id
PHP Code:
public fw_ThinkGrenade(entity) { 
PHP Code:
public fw_SetModel(entity, const model[]) { 

En una parte del code dice esto puede hacerse esto aca ?

PHP Code:
entity_set_vector(iEntity,EV_VEC_originOrigin)
entity_set_model(iEntity,model)
entity_set_int(iEntityEV_INT_solidSOLID_TRIGGER)
entity_set_size(iEntityFloat: {-100.0, -100.0, -100.0}, Float: {100.0100.0100.0})
entity_set_int(iEntityEV_INT_renderfxkRenderFxGlowShell)
entity_set_int(iEntityEV_INT_rendermodekRenderTransAlpha)
entity_set_float(iEntityEV_FL_renderamt50.0)

entity_set_int(iEntityEV_INT_iuser4get_user_team (UserTeam == CS_TEAM_CT
Por lo que yo pienso que algo de aca debe ser pero no estoy seguro espero que me puedan ayudar
PHP Code:
 entity_set_int(iEntityEV_INT_iuser4get_user_team (UserTeam == CS_TEAM_CT
Gracias.

Last edited by lucas_7_94; 06-18-2012 at 19:04. Reason: [ZP] Ayuda bubble para HNS (Chequeo de equipos)
Usertarget is offline
r0ma
Senior Member
Join Date: Apr 2012
Location: Great Tomb of Nazarick
Old 06-18-2012 , 01:23   Re: Como hago que solo Un Terrorista ocupe este comando
#2

este user me acaba de pasar el sma por msn y le roba el author a lucas_7_94
__________________
Discord:FluffyDeveloper#4753
Github: https://github.com/francoromaniello
AMX-ES: https://amxmodx-es.com/r0ma'
r0ma is offline
Send a message via MSN to r0ma
eXacT
Veteran Member
Join Date: Apr 2009
Location: Buenos Aires
Old 06-18-2012 , 03:49   Re: Como hago que solo Un Terrorista ocupe este comando
#3

segun lo que veo estas trantando con HNS, por lo cual, el HNS por defecto no le deja usar bombas a los CT's entonces podrias registrar el comando normalmente y cuando los ct's lo usen no va a pasar nada supongo, por que tienen restringido el item, en cambio si lo pone un tt se lo va a dar.
__________________

"There is no knowledge, that is not power"
eXacT is offline
Send a message via MSN to eXacT Send a message via Skype™ to eXacT
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 06-18-2012 , 04:48   Re: Como hago que solo Un Terrorista ocupe este comando
#4

Me marie un poco con la explicación , podes postear lo que es el code completo que vos tenes , las cosas que queres hacerle y nosotros te decimos/hacemos lo recomendado ?
__________________
ATWWMH - MiniDuels
Madness is like gravity, just need a little push.
lucas_7_94 is offline
Send a message via Skype™ to lucas_7_94
Usertarget
New Member
Join Date: Jun 2012
Old 06-18-2012 , 11:49   Re: Como hago que solo Un Terrorista ocupe este comando
#5

Quote:
Originally Posted by lucas_7_94 View Post
Me marie un poco con la explicación , podes postear lo que es el code completo que vos tenes , las cosas que queres hacerle y nosotros te decimos/hacemos lo recomendado ?

La verdad esque no es una granada pero solo lo puse asi para poder dar un ejemplo , pero ami me lo paso el un tipo y yo se lo pase tal cual a roma para que me ayudara pero al ver que el autor era lucas , y abajo decia by : st... personaje que ocultare su identidad me dijo que no me ayudaria en mi plugin , la verdad es una burbuja solo que cambie unas cosas a granada para poder proteger el plugin pero es un campo !
Espero que me puedan ayudar , lo de roma fue algo confuso ya que asi me pasaron el plugin ami en el autor decia lucas , y abajo decia un mensaje by St.... : Has comprado un campo solo fue eso espero que me puedan ayudar y gracias
Usertarget is offline
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 06-18-2012 , 13:08   Re: Como hago que solo Un Terrorista ocupe este comando
#6

Es que , aver , yo por lo menos me confundo en lo que queres hacer, en un momento seteas iuser4 con el equipo (???????????) , por eso te digo , no entiendo , si posteas TODO el codigo , yo u otro usuario puede dejarlo como vos queres ,de paso , aprendes vos tambien.
__________________
ATWWMH - MiniDuels
Madness is like gravity, just need a little push.
lucas_7_94 is offline
Send a message via Skype™ to lucas_7_94
r0ma
Senior Member
Join Date: Apr 2012
Location: Great Tomb of Nazarick
Old 06-18-2012 , 15:10   Re: Como hago que solo Un Terrorista ocupe este comando
#7

aca esta el code
PHP Code:

#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <cstrike>
#include <hamsandwich>
#include <fakemeta_util>
#include <fun>

#define PLUGIN "[HNS - ITEM]: Campo De Fuerza"
#define VERSION "v2.0"
#define AUTHOR "lucas_7_94" // Thanks To Users in credits too!.

#define CAMPO_ROUND_NAME "Campo De Fuerza"
#define CAMPO_TIME_NAME "Campo De Fuerza"

/*=============================[Plugin Customization]=============================*/
#define CAMPO_TASK
//#define CAMPO_ROUND


//#define RANDOM_COLOR
#define ONE_COLOR
new const NADE_TYPE_CAMPO 4367

#if defined ONE_COLOR
new Float:CampoColors[3] = { 0.0 0.0 255.0 }
#endif


#define PRICE 7000

new VIEW_MODEL[] = "models/campo/v_auragren.mdl" 

new const model[] = "models/campo/aura8.mdl"
//new const w_model[] = "models/w_smokegrenade.mdl"
new const sprite_grenade_trail[] = "sprites/laserbeam.spr"
new const entclas[] = "campo_grenade_hielo"
new g_trailSprg_SayText

new bool:g_buy_bomb[33]

new 
Glowx

/*=============================[End Customization]=============================*/

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
RegisterHam(Ham_Think"grenade""fw_ThinkGrenade")
    
    
RegisterHam(Ham_Spawn"player""fw_PlayerSpawn_Post"1)
    
    
register_forward(FM_SetModel"fw_SetModel")

    
register_event("HLTV""event_round_start""a""1=0""2=0")
    
    
register_touch(entclas"player""entity_touch")

    
register_event("CurWeapon""Event_CurWeapon""be","1=1")
    
    
g_SayText get_user_msgid("SayText")
    
    
register_clcmd("say /hielo""clcmd_campo")
}

public 
plugin_natives()
    
register_native("hns_campo_hielo""native_campo_hielo"1)

public 
native_campo_hielo(id)
         
g_buy_bomb[id] = true

public clcmd_campo2(id)
{
    
g_buy_bomb[id] = true
}

public 
clcmd_campo(id)
{
    if(!
is_user_alive(id))
        return 
PLUGIN_HANDLED;
        
    if(
cs_get_user_money(id) < PRICE)
    {
        
client_print(idprint_chat"[By StorM 2.0] No tienes suficiente dinero para comprar un campo de fuerza de hielo ($%d)"PRICE)
        return 
PLUGIN_HANDLED;
    }
    
    
g_buy_bomb[id] = true
    fm_give_item
(id"weapon_smokegrenade")
    
cs_set_user_money(idcs_get_user_money(id) - PRICE)
    
    return 
PLUGIN_CONTINUE;
}

public 
fw_PlayerSpawn_Post(id)
{
    if(!
is_user_connected(id))
        return;
}
public 
event_round_start() {
    
    
#if defined CAMPO_ROUND
    
remove_entity_name(entclas)
    
#endif
}

public 
plugin_precache() {
    
    
g_trailSpr engfunc(EngFunc_PrecacheModelsprite_grenade_trail)
    
engfunc(EngFunc_PrecacheModelmodel)
    
//engfunc(EngFunc_PrecacheModel, w_model)
    
precache_model(VIEW_MODEL
    
Glowx precache_model("sprites/blueflare1.spr")
}

public 
Event_CurWeapon(id
{     
    new 
weaponID read_data(2
    
    if(
weaponID != CSW_SMOKEGRENADE)
        return 
PLUGIN_CONTINUE
    
    
if(!g_buy_bomb[id])
        return 
PLUGIN_CONTINUE;
    
    
entity_set_string(idEV_SZ_viewmodelVIEW_MODEL)
    
    return 
PLUGIN_CONTINUE 
}

public 
fw_ThinkGrenade(entity) {   
    
    if(!
pev_valid(entity)) return HAM_IGNORED
    
    
static Float:dmgtime   
    pev
(entitypev_dmgtimedmgtime)
    
    if (
dmgtime get_gametime())
        return 
HAM_IGNORED   
    
    
if(pev(entitypev_flTimeStepSound) == NADE_TYPE_CAMPO
    {
        
g_buy_bomb[pev(entitypev_owner)] = false
        crear_ent
(entity)
        
remove_entity(entity)
        return 
HAM_SUPERCEDE
    
}
    return 
HAM_IGNORED   
}

    
public 
fw_SetModel(entity, const model[]) {    
    
    static 
Float:dmgtime
    pev
(entitypev_dmgtimedmgtime)
    
    if (
dmgtime == 0.0)
        return 
FMRES_IGNORED;
    
    new 
id pev(entitypev_owner)
    
    if(
g_buy_bomb[id])
    {
        if (
equal(model[7], "w_sm"4))
        {        
            
fm_set_rendering(entitykRenderFxGlowShell00255kRenderNormal16)
            
            
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
            
write_byte(TE_BEAMFOLLOW// TE id
            
write_short(entity// entity
            
write_short(g_trailSpr// sprite
            
write_byte(10// life
            
write_byte(10// width
            
write_byte(000// r
            
write_byte(255// g
            
write_byte(255// b
            
write_byte(500// brightness
            
message_end()
            
            
set_pev(entitypev_flTimeStepSoundNADE_TYPE_CAMPO)
                
            
//entity_set_model(entity, w_model)
            
return FMRES_SUPERCEDE
        
}
    }
    return 
FMRES_IGNORED
    
}


public 
crear_ent(ent
{
    
    
// Create entitity
    
new iEntity create_entity("info_target")
    
    if(!
is_valid_ent(iEntity))
        return 
PLUGIN_HANDLED
    
    
new FloatOrigin[3
    
entity_get_vector(entEV_VEC_originOrigin
    
    
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYOrigin0)
    
write_byte(TE_SPRITETRAIL)
    
engfunc(EngFunc_WriteCoordOrigin[0]) // X
    
engfunc(EngFunc_WriteCoordOrigin[1]) // Y
    
engfunc(EngFunc_WriteCoordOrigin[2]) // Z
    
engfunc(EngFunc_WriteCoordOrigin[0]) // X
    
engfunc(EngFunc_WriteCoordOrigin[1]) // Y
    
engfunc(EngFunc_WriteCoordOrigin[2]) // Z
    
write_short(Glowx//Sprite 
    
write_byte(100//amount
    
write_byte(1)  //life
    
write_byte(2)  //width
    
write_byte(60//speed
    
write_byte(60//speed
    
message_end()  
    
    
entity_set_string(iEntityEV_SZ_classnameentclas)
    
    
entity_set_vector(iEntity,EV_VEC_originOrigin)
    
entity_set_model(iEntity,model)
    
entity_set_int(iEntityEV_INT_solidSOLID_TRIGGER)
    
entity_set_size(iEntityFloat: {-100.0, -100.0, -100.0}, Float: {100.0100.0100.0})
    
entity_set_int(iEntityEV_INT_renderfxkRenderFxGlowShell)
    
entity_set_int(iEntityEV_INT_rendermodekRenderTransAlpha)
    
entity_set_float(iEntityEV_FL_renderamt50.0)
    
    
entity_set_int(iEntityEV_INT_iuser4get_user_team(entity_get_edict(entEV_ENT_owner)))
    
    
#if defined RANDOM_COLOR
    
if(is_valid_ent(iEntity))
    {
        new 
Float:vColor[3]
        
        
vColor[0] = 0
        vColor
[1] = 0
        vColor
[2] = 255
        
        entity_set_vector
(iEntityEV_VEC_rendercolorvColor)
    }
    
#endif

    #if defined ONE_COLOR
    
entity_set_vector(iEntityEV_VEC_rendercolorCampoColors)
    
#endif
    
    #if defined CAMPO_TASK
    
set_task(15.0"DeleteEntity"iEntity)
    
#endif
    
    
    
return PLUGIN_CONTINUE;
}

public 
entity_touch(entid) {
    if(
entity_get_int(entEV_INT_iuser4) != get_user_team(id))
    {
        new 
Float:pos_ptr[3], Float:pos_ptd[3], Float:push_power 6.0
                
        pev
(entpev_originpos_ptr)
        
pev(idpev_originpos_ptd)
                
        for(new 
03i++)
        {
            
pos_ptd[i] -= pos_ptr[i]
            
pos_ptd[i] *= push_power
        
}
        
set_pev(idpev_velocitypos_ptd)
        
set_pev(idpev_impulsepos_ptd)
        
        if(
callfunc_begin("freeze_player","frostnades2.amxx") == 1)
        {
            
callfunc_push_int(id);
            
callfunc_push_int(pev(entity_get_int(entEV_INT_iuser4),pev_team));
            
callfunc_end();
        }
        
        if(
callfunc_begin("chill_player","frostnades2.amxx") == 1)
        {
            
            
callfunc_push_int(id);
            
callfunc_push_int(pev(entity_get_int(entEV_INT_iuser4),pev_team));
            
callfunc_end();
        }
    }
}

public 
remove_ent() {
    
remove_entity_name(entclas)
}  

public 
DeleteEntityentity )  // Thanks xPaw For The Code =D
    
if( is_valid_ententity ) ) 
    
remove_entityentity );

stock Color(const id, const input[], any:...)
{
    static 
msg[191]
    
vformat(msg190input3)
    
    
replace_all(msg190"!g""^4")
    
replace_all(msg190"!y""^1")
    
replace_all(msg190"!t""^3")
    
    
message_begin(MSG_ONE_UNRELIABLEg_SayText_id)
    
write_byte(id)
    
write_string(msg)
    
message_end()
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1034\\ f0\\ fs16 \n\\ par }
*/ 
__________________
Discord:FluffyDeveloper#4753
Github: https://github.com/francoromaniello
AMX-ES: https://amxmodx-es.com/r0ma'
r0ma is offline
Send a message via MSN to r0ma
DJHD!
Veteran Member
Join Date: Dec 2009
Location: Santiago, Chile
Old 06-18-2012 , 15:29   Re: Como hago que solo Un Terrorista ocupe este comando
#8

wtf ese plugin
__________________
Quote:
Originally Posted by XINLEI View Post
Porque rocccos trata de ser el metalicross que nunca va a poder ser.
DJHD! is offline
Send a message via MSN to DJHD!
Geoslide
Senior Member
Join Date: Jun 2011
Location: Chilean player
Old 06-18-2012 , 15:52   Re: Como hago que solo Un Terrorista ocupe este comando
#9

dble account ?
__________________
Basebuilder V6 - plugin for sale
Jailbreak V6 - plugin for sale
more plugins in progress ...

Geoslide ?
Geoslide is offline
rak
Veteran Member
Join Date: Oct 2011
Location: banned country
Old 06-18-2012 , 16:06   Re: Como hago que solo Un Terrorista ocupe este comando
#10

Quote:
Originally Posted by Geoslide View Post
dble account ?
no; no viste q r0ma posteo primero diciendo que el le robaba el autor a lucas..
__________________

www.amxmodx-es.com

Steam: Luchokoldo
rak is offline
Send a message via MSN to rak Send a message via Skype™ to rak
 



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:09.


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