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

[ES] Una ayuda.


  
 
 
Thread Tools Display Modes
Author Message
Javivi
AlliedModders Donor
Join Date: Dec 2008
Old 07-10-2009 , 06:50   [ES] Una ayuda.
#1

Como haria esto?:

Yo pongo amx_happy NICK

Y al escribir eso, la persona recibe una awp y el servidor ejecuta el comando amx_ammo NICK sobre ella?

Seria algo asi??

PHP Code:
server_cmd(amx_ammo target
Si me pudieran decir como hacerlo (usando target para definir al player). Gracias :d
Javivi is offline
ILUSION
Senior Member
Join Date: Oct 2006
Location: Argentina
Old 07-10-2009 , 07:14   Re: [ES] Una ayuda.
#2

No entendí bien, pero creo que lo que querés es que cuando ponga amx_happy javivi te de un awp y el servidor al mismo tiempo ejecute el comando amx_ammo javivi

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

public plugin_init() {
    
register_plugin("asd""1.0""ILUSION")
    
register_concmd("amx_happy""cmdHappy"ADMIN_KICK"<nick>")
}

public 
cmdHappy(idlevelcid)
{
    if(!
cmd_access(idlevelcid2))
        return 
PLUGIN_HANDLED
        
    
new arg[32]
    
read_argv(1argsizeof arg 1)
    
    new 
target cmd_target(idargCMDTARGET_ALLOW_SELF)
    
    if (!
target) return PLUGIN_HANDLED
    
    give_item
(target"weapon_awp")
    
    
server_cmd("amx_ammo #%d"get_user_userid(target))
    
    return 
PLUGIN_HANDLED

Saludos
ILUSION is offline
Javivi
AlliedModders Donor
Join Date: Dec 2008
Old 07-10-2009 , 09:24   Re: [ES] Una ayuda.
#3

Exacto!!!

Y una pregunta
PHP Code:
 server_cmd("amx_ammo #%d"get_user_userid(target)) 
Donde defines que ese %d es el nick ?

Y otra, el # ese es necesario para indicar el nick?

Y otra, como podria hacer si solo necesitara ejecutar un comando sobre alguien usando lo que pusiste?
osea el amx_ammo NICK pero sin lo de la awp y demas.

Gracias
Javivi is offline
ILUSION
Senior Member
Join Date: Oct 2006
Location: Argentina
Old 07-10-2009 , 10:00   Re: [ES] Una ayuda.
#4

%d lo estoy definiendo como el número de ID del target ( get_user_userid(index) ). Por lo cual el servidor ejecutaría amx_ammo #1 (ejemplo)

Si querés que sea por nombre:

PHP Code:
new nombre[32]
get_user_name(targetnombresizeof nombre 1)
server_cmd("amx_ammo %s"nombre
Saludos

PD: No entendí lo último.
ILUSION is offline
Javivi
AlliedModders Donor
Join Date: Dec 2008
Old 07-10-2009 , 11:24   Re: [ES] Una ayuda.
#5

Es igual, ya lo tengo todo solucionado, gracias
Javivi 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 01:56.


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