Raised This Month: $ Target: $400
 0% 

change any players hp/ap/e.g. and how does i get player id


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
timian
Member
Join Date: Oct 2006
Location: Denmark
Old 06-16-2009 , 16:24   change any players hp/ap/e.g. and how does i get player id
Reply With Quote #1

how do i change all players stats?


i know this code, but how did i get a players id!?
set_user_health(id, health)
timian is offline
AntiBots
Veteran Member
Join Date: May 2008
Location: Brazil
Old 06-16-2009 , 16:39   Re: change any players hp/ap/e.g. and how does i get player id
Reply With Quote #2

PHP Code:
public lala()
{
    for( new 
1<= 32i++ )
    {
        if( 
is_user_alive(i) )
        {
            
set_user_health(i250);
        }
    }

__________________

Last edited by AntiBots; 06-16-2009 at 16:41. Reason: Use FireFox
AntiBots is offline
Send a message via ICQ to AntiBots Send a message via MSN to AntiBots Send a message via Skype™ to AntiBots
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 06-16-2009 , 17:01   Re: change any players hp/ap/e.g. and how does i get player id
Reply With Quote #3

Quote:
Originally Posted by AntiBots View Post
PHP Code:
public lala()
{
    for( new 
1<= 32i++ )
    {
        if( 
is_user_alive(i) )
        {
            
set_user_health(i250);
        }
    }

You should use get_maxplayers() or get_players.
SnoW is offline
Send a message via MSN to SnoW
timian
Member
Join Date: Oct 2006
Location: Denmark
Old 06-16-2009 , 17:08   Re: change any players hp/ap/e.g. and how does i get player id
Reply With Quote #4

snow - does you mean that get_players() return players id?

and thanks for the code
timian is offline
AntiBots
Veteran Member
Join Date: May 2008
Location: Brazil
Old 06-16-2009 , 17:11   Re: change any players hp/ap/e.g. and how does i get player id
Reply With Quote #5

Quote:
Originally Posted by SnoW View Post
You should use get_maxplayers() or get_players.
Yes, I do on NoteBlock so I do very simple. Sorry

@timian to get a Specific player Id use get_player( ......... ) se amxmodx.inc

also if you use the loop put a variable = get_maxplayers() on plugin_init and then replace 32->The_Variable_Name
__________________
AntiBots is offline
Send a message via ICQ to AntiBots Send a message via MSN to AntiBots Send a message via Skype™ to AntiBots
timian
Member
Join Date: Oct 2006
Location: Denmark
Old 06-16-2009 , 17:17   Re: change any players hp/ap/e.g. and how does i get player id
Reply With Quote #6

Code:
public set_stats {
    for(new i = 1; i <= 32; i++) {
        if(is_user_alive(i)) {
            set_user_health(i, 400)
            set_user_maxspeed(i, float:speed = 5.0)
        }
    }
}
does this work? and is it right that i just can complie it to get my answer?
timian is offline
AntiBots
Veteran Member
Join Date: May 2008
Location: Brazil
Old 06-16-2009 , 17:32   Re: change any players hp/ap/e.g. and how does i get player id
Reply With Quote #7

set_stats() <- void argument but you need tu put (), also if you only need to put set_user_maxspeed(i, 5.0) and replace the 32. with a variable with get_maxplayers()
__________________
AntiBots is offline
Send a message via ICQ to AntiBots Send a message via MSN to AntiBots Send a message via Skype™ to AntiBots
timian
Member
Join Date: Oct 2006
Location: Denmark
Old 06-16-2009 , 17:42   Re: change any players hp/ap/e.g. and how does i get player id
Reply With Quote #8

don't understand!?

would this work!? xD

Code:
public set_stats {
    for(new i = 1; i <= get_max_player; i++) {
        if(is_user_alive(i)) {
            set_user_health(i, 400)
            set_user_maxspeed(i, float:speed = 5.0)
        }
    }
}
timian is offline
AntiBots
Veteran Member
Join Date: May 2008
Location: Brazil
Old 06-16-2009 , 17:59   Re: change any players hp/ap/e.g. and how does i get player id
Reply With Quote #9

PHP Code:
public set_stats()
{
    for(new 
1<= get_max_playeri++) 
    {
        if(
is_user_alive(i)) 
        {
            
set_user_health(i400)
            
set_user_maxspeed(i320.0)
        }
    }

__________________
AntiBots is offline
Send a message via ICQ to AntiBots Send a message via MSN to AntiBots Send a message via Skype™ to AntiBots
timian
Member
Join Date: Oct 2006
Location: Denmark
Old 06-16-2009 , 18:21   Re: change any players hp/ap/e.g. and how does i get player id
Reply With Quote #10

ahh can think i forgot that! thanks alot!
timian is offline
Reply


Thread Tools
Display Modes

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 13:55.


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