Raised This Month: $ Target: $400
 0% 

get_user_frags . please help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Sage_UA
Junior Member
Join Date: Dec 2008
Old 01-10-2009 , 10:48   get_user_frags . please help
Reply With Quote #1

Code:
public plugin_init()
{
    register_plugin(PLUGIN, VERSION, AUTHOR)
    set_task(1.0, "pokazivalka", 1, "", 0, "b")
}

public pokazivalka()
{
    new fragi[5], smerti[5], hp[5]
        
        get_user_frags(id, fragi, sizeof fragi -1)
        get_user_deaths(id, smerti, sizeof smerti -1)
        get_user_health(id, hp, sizeof hp -1)
        
    set_hudmessage(255, 0, 255, 0.01, 0.15, 0, 6.0, 2.0)
    show_hudmessage(id, "Health: %s HP^nFrags: %s^nDeaths: %s", hp, fragi, smerti)
}
errors:



please help
Sage_UA is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 01-10-2009 , 11:04   Re: get_user_frags . please help
Reply With Quote #2

you should loop that throught all players.
__________________
xPaw is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 01-10-2009 , 11:09   Re: get_user_frags . please help
Reply With Quote #3

Since you're using a task which doesn't pass the player's id, you need to loop through all players, in pokazivalka().
Arkshine is offline
Sage_UA
Junior Member
Join Date: Dec 2008
Old 01-10-2009 , 11:32   Re: get_user_frags . please help
Reply With Quote #4

i have not understood something.
instead of pokazivalka() to make pokazivalka(id) ?

Can give a code please

ps
from me karma+
Sage_UA is offline
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 01-10-2009 , 11:43   Re: get_user_frags . please help
Reply With Quote #5

Read again what ark said.
PHP Code:
new g_maxplayers;
public 
plugin_init() g_maxplayers get_maxplayers(); // ..
public pokazivalka()
{
    for( new 
id 1id <= g_maxplayersid++ )
    {
          
// your code here

__________________

anakin_cstrike is offline
Sage_UA
Junior Member
Join Date: Dec 2008
Old 01-10-2009 , 12:16   Re: get_user_frags . please help
Reply With Quote #6

i the beginner in pawn scripting, also do not understand about what you.

also what it for a code which has given anakin_cstrike

you could not transform to it in my code? please.
Sage_UA is offline
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 01-10-2009 , 12:25   Re: get_user_frags . please help
Reply With Quote #7

Lol, messed with these colors...
Code:
new g_maxplayers;
public plugin_init() 
{
    register_plugin(PLUGIN, VERSION, AUTHOR)
    set_task(1.0, "pokazivalka", 1, "", 0, "b")
    g_maxplayers = get_maxplayers(); 
}
public pokazivalka()
{
    new fragi[5], smerti[5], hp[5]
    for( new id = 1; id <= g_maxplayers; id++ )
    {
        get_user_frags(id, fragi, sizeof fragi -1)
        get_user_deaths(id, smerti, sizeof smerti -1)
        get_user_health(id, hp, sizeof hp -1)
        
        set_hudmessage(255, 0, 255, 0.01, 0.15, 0, 6.0, 2.0)
        show_hudmessage(id, "Health: %s HP^nFrags: %s^nDeaths: %s", hp, fragi, smerti)
          
    }
}
SnoW is offline
Send a message via MSN to SnoW
Sage_UA
Junior Member
Join Date: Dec 2008
Old 01-10-2009 , 12:38   Re: get_user_frags . please help
Reply With Quote #8

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

#define PLUGIN "Frags and Death pod radarom"
#define VERSION "1.0"
#define AUTHOR "maJic"


new g_maxplayers

public plugin_init() 
{
    register_plugin(PLUGIN, VERSION, AUTHOR)
    
    set_task(1.0, "pokazivalka", 1, "", 0, "b")
    
    g_maxplayers = get_maxplayers()
}

public pokazivalka()
{
    new fragi[5], smerti[5], hp[5]
    
    for( new id = 1; id <= g_maxplayers; id++ )
    {
    get_user_frags(id, fragi, sizeof fragi -1)
    get_user_deaths(id, smerti, sizeof smerti -1)
    get_user_health(id, hp, sizeof hp -1)
        
        set_hudmessage(255, 0, 255, 0.01, 0.15, 0, 6.0, 2.0)
        show_hudmessage(id, "Health: %s HP^nFrags: %s^nDeaths: %s", hp, fragi, smerti)
          
    }
}
errors

on lines:
Code:
    get_user_frags(id, fragi, sizeof fragi -1)
    get_user_deaths(id, smerti, sizeof smerti -1)
    get_user_health(id, hp, sizeof hp -1)
%)
Sage_UA is offline
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 01-10-2009 , 13:14   Re: get_user_frags . please help
Reply With Quote #9

I never fixed the code, just attached them like you wanted.
The values must be int, still you could set them in the show_hud straigth, so you don't need to create values for them, still just showing how to do with ints:
Code:
#include <amxmodx>
#include <amxmisc>
#define PLUGIN "Frags and Death pod radarom"
#define VERSION "1.0"
#define AUTHOR "maJic"
 
new g_maxplayers
public plugin_init() 
{
    register_plugin(PLUGIN, VERSION, AUTHOR)
 
    set_task(1.0, "pokazivalka", 1, "", 0, "b")
 
    g_maxplayers = get_maxplayers()
}
public pokazivalka()
{
    for( new id = 1; id <= g_maxplayers; id++ )
    {
       new fragi = get_user_frags(id);
       new smerti = get_user_deaths(id);
       new hp = get_user_health(id);      
        set_hudmessage(255, 0, 255, 0.01, 0.15, 0, 6.0, 2.0)
        show_hudmessage(id, "Health: %i HP^nFrags: %i^nDeaths: %i", hp, fragi, smerti)
 
    }
}
SnoW is offline
Send a message via MSN to SnoW
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 01-10-2009 , 13:27   Re: get_user_frags . please help
Reply With Quote #10

PHP Code:
#include <amxmodx>

#define PLUGIN    "Frags & Deaths under radar"
#define VERSION    "1.0"
#define AUTHOR    "maJic"

new gMaxPlayers;

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)

    
set_task(1.0"pokazivalka"1""0"b")
    
gMaxPlayers get_maxplayers()
}

public 
pokazivalka() {
    for( new 
id 1id <= gMaxPlayersid++ ) {
        if( 
is_user_alive(id) ) {
            
set_hudmessage(25502550.010.1501.01.0);
            
show_hudmessage(id"Health: %i HP^nFrags: %i^nDeaths: %i"get_user_health(id), get_user_frags(id), get_user_deaths(id));
        }
    }

__________________

Last edited by xPaw; 01-11-2009 at 04:44.
xPaw is offline
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 09:13.


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