AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   user weapon name. (https://forums.alliedmods.net/showthread.php?t=99500)

Mr.Noobie 08-06-2009 05:44

user weapon name.
 
Does anyone know how to i get user weapon name ??

get_user_weaponname( id ) doesn't work.

Bugsy 08-06-2009 10:27

Re: user weapon name.
 
PHP Code:

new iWeapon get_user_weaponid );
new 
szWeapon20 ];
    
if ( 
iWeapon )
    
get_weaponnameiWeapon szWeapon 19 ); 


Arkshine 08-06-2009 10:41

Re: user weapon name.
 
Next time, try to search by yourself a bit : http://www.amxmodx.org/funcwiki.php ; not that hard to type "weapon" to see the native related to that.

Mr.Noobie 08-06-2009 11:56

Re: user weapon name.
 
Quote:

Originally Posted by Arkshine (Post 891704)
Next time, try to search by yourself a bit : http://www.amxmodx.org/funcwiki.php ; not that hard to type "weapon" to see the native related to that.

I did, but i don't understand that why i post here :(

tuty 08-07-2009 06:28

Re: user weapon name.
 
http://forums.alliedmods.net/showthr...t_user_weapon2 heh, xpaw

Mr.Noobie 08-07-2009 08:03

Re: user weapon name.
 
Quote:

Originally Posted by tuty (Post 892415)

I try the step from xpaw still can't work the Weapon: %s is Weapon: k

PHP Code:

public get_user_weapon2id ) { 
    new 
szWeapon20 ]; 
    
get_weaponnameget_user_weaponid ), szWeaponcharsmaxszWeapon ) ); 
 
    return 
szWeapon[7]; 


PHP Code:

show_hudmessage(id," Weapon: %s" get_user_weapon2(id)) 


Bugsy 08-07-2009 09:58

Re: user weapon name.
 
Quote:

Originally Posted by Mr.Noobie (Post 892474)
I try the step from xpaw still can't work the Weapon: %s is Weapon: k

PHP Code:

public get_user_weapon2id ) { 
    new 
szWeapon20 ]; 
    
get_weaponnameget_user_weaponid ), szWeaponcharsmaxszWeapon ) ); 
 
    return 
szWeapon[7]; 


PHP Code:

show_hudmessage(id," Weapon: %s" get_user_weapon2(id)) 


PHP Code:

show_hudmessageid " Weapon: %s" get_user_weapon2id ) ) 


Mr.Noobie 08-08-2009 00:24

Re: user weapon name.
 
Quote:

Originally Posted by Bugsy (Post 892546)
PHP Code:

show_hudmessageid " Weapon: %s" get_user_weapon2id ) ) 


Still didn't work.

Bugsy 08-08-2009 00:37

Re: user weapon name.
 
Did you first call set_hudmessage()?

Mr.Noobie 08-08-2009 00:47

Re: user weapon name.
 
Quote:

Originally Posted by Bugsy (Post 893129)
Did you first call set_hudmessage()?

I don't get it.

btw here is the whole codes.

PHP Code:


/**************************************************
* AMXX Script  *      *
* Author: Yuri *      *
*  Version 0.1  * * * * * * * * * * * * * *
* Look at a player and see their name. lolz   *
***************************************************/
#include <amxmodx>
#include <amxmisc>

new friend[33]
public 
set_team(id)
friend[id] = read_data(2)

public 
hide_status(id){
set_hudmessage(0,0,0,0.0,0.0,00.00.010.00.04)
show_hudmessage(id,"")
}

public 
get_user_weapon2id ) { 
    new 
szWeapon20 ]; 
    
get_weaponnameget_user_weaponid ), szWeaponcharsmaxszWeapon ) ); 
     
    return 
szWeapon[7]; 

 
public 
show_status(id){
new 
name[32],pid read_data(2)
get_user_name(pid,name,31)
if (
friend[id] == 1){ /* friend */
set_hudmessage(0,0,225,-1.0,0.60,10.013.00.010.014/* blue */
show_hudmessage(id,"Friend: %s - Health: %d | Armor: %d | Weapon: %s",name,
get_user_health(pid),get_user_armor(pid),get_user_weapon2(pid))
}

else {
set_hudmessage(255,0,0,-1.0,0.60,10.013.00.010.014/* red */
show_hudmessage(id,"Enemy: %s",name)
}
}

public 
plugin_init(){
register_plugin("Player Name","0.1","Yuri")
register_event("StatusValue","set_team","be","1=1")
register_event("StatusValue","show_status","be","1=2","2!0")
register_event("StatusValue","hide_status","be","1=1","2=0")




All times are GMT -4. The time now is 18:22.

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