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

replace armor value


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
elantra86
Member
Join Date: Feb 2014
Old 03-16-2014 , 10:32   replace armor value
Reply With Quote #1

have this script.
Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
 
#define PLUGIN "get_distance_f"
#define VERSION "1.0"
#define AUTHOR "Admin"
 
public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR)
    register_clcmd("say dis","dis")
//    set_msg_block( get_user_msgid( "Battery" ), BLOCK_SET )
}

public dis(id){
    new forigin[3]
    new sorigin[3]
    get_user_origin(id, forigin)
    get_user_origin(id, sorigin, 3)
    new distance = get_distance(forigin, sorigin)
    client_print(id, print_chat,"Distance: %d units",distance)
    return PLUGIN_HANDLED
}
help to replace armor value with value of distance.
elantra86 is offline
Kiske
Veteran Member
Join Date: May 2009
Old 03-16-2014 , 10:43   Re: replace armor value
Reply With Quote #2

PHP Code:
#include <fun>

set_user_armor(idclamp(distance0999); 
__________________

Kiske is offline
Send a message via Skype™ to Kiske
elantra86
Member
Join Date: Feb 2014
Old 03-16-2014 , 10:52   Re: replace armor value
Reply With Quote #3

wont compile.
can u show me full script please.

Last edited by elantra86; 03-16-2014 at 10:52.
elantra86 is offline
Buckshot
Senior Member
Join Date: Mar 2014
Location: Sweden
Old 03-16-2014 , 10:54   Re: replace armor value
Reply With Quote #4

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <cstrike>
 
#define PLUGIN "get_distance_f"
#define VERSION "1.0"
#define AUTHOR "Admin"
 
public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("say dis","dis")
//    set_msg_block( get_user_msgid( "Battery" ), BLOCK_SET )
}

public 
dis(id){
    new 
forigin[3]
    new 
sorigin[3]
    
get_user_origin(idforigin)
    
get_user_origin(idsorigin3)
    new 
distance get_distance(foriginsorigin)
    
cs_set_user_armor(iddistanceCS_ARMOR_VESTHELM)
    
client_print(idprint_chat,"Distance: %d units",distance)
    return 
PLUGIN_HANDLED

Just do this?
__________________
PM me for private work.



Last edited by Buckshot; 03-16-2014 at 10:54.
Buckshot is offline
Send a message via Skype™ to Buckshot
elantra86
Member
Join Date: Feb 2014
Old 03-16-2014 , 10:58   Re: replace armor value
Reply With Quote #5

Thx for quick reply...
but need show this value every time without command(& without max value).
thx in advance

Last edited by elantra86; 03-16-2014 at 11:01.
elantra86 is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 03-16-2014 , 11:01   Re: replace armor value
Reply With Quote #6

Then you need to figure out a different solution. Why do you want to set the armor value to the distance?
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
elantra86
Member
Join Date: Feb 2014
Old 03-16-2014 , 11:05   Re: replace armor value
Reply With Quote #7

Quote:
Originally Posted by YamiKaitou View Post
Then you need to figure out a different solution. Why do you want to set the armor value to the distance?
for kreedz mode ) thats not important the value of health & armor
if you know solution plz help.

Last edited by elantra86; 03-16-2014 at 11:29.
elantra86 is offline
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 03-18-2014 , 13:04   Re: replace armor value
Reply With Quote #8

This will be updated very frequently.
If you have performance issues you should make it a task or a custom think. Tasks are not very fast (~10/s) while think is highly customizable.
If so, just tell me. I'll help you.
Code:
#include <amxmodx> #include <cstrike> public plugin_init()     register_plugin("Distance", "1.0", "Admin"); public client_PreThink(id) {     static forigin[3], sorigin[3];         get_user_origin(id, forigin);     get_user_origin(id, sorigin, 3);         cs_set_user_armor(id, clamp(get_distance(forigin, sorigin), 0, 999), CS_ARMOR_VESTHELM); }
__________________
Black Rose is offline
elantra86
Member
Join Date: Feb 2014
Old 03-19-2014 , 00:46   Re: replace armor value
Reply With Quote #9

Thank you very much!!!!!!!
Excelent work. this that that i want.
& 1 question (Whether it is possible?):
how to add command to disable or enable this func?
is the max value 999 or i can set more?
sorry for me eng.

Last edited by elantra86; 03-19-2014 at 05:28.
elantra86 is offline
mottzi
Veteran Member
Join Date: May 2010
Location: Switzerland
Old 03-19-2014 , 02:46   Re: replace armor value
Reply With Quote #10

Search for the clamp function in the docs.
mottzi is offline
Send a message via MSN to mottzi
Reply



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 21:16.


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