Raised This Month: $ Target: $400
 0% 

help for change use plugin


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Saulius
Junior Member
Join Date: Jul 2011
Location: Avignon
Old 02-03-2013 , 20:45   help for change use plugin
Reply With Quote #1

Hi I post to ask for help for 2 script of course script works but the only problem knows that the script used to display hudhp.sma life does not stay all time display

Code:
#include <amxmodx>

#define PLUGIN "Health Display"
#define VERSION "1.0"
#define AUTHOR "LeviN"

new g_HudSyncObj

public plugin_init()
{
    register_plugin(PLUGIN, VERSION, AUTHOR)
    register_message(get_user_msgid("Health"), "Message_Health")
    g_HudSyncObj = CreateHudSyncObj()
}

public Message_Health(iMsgId, MSG_DEST, id)
{
    new iHealth = get_user_health(id)
    if(iHealth > 255) // credit to vittu
    {
        set_msg_arg_int(1, ARG_BYTE, 255)
    }

    set_hudmessage(255, 255, 0, 0.038, 0.75, 2, 10000, 1000.0, 10000, 3.0, -1)
    ShowSyncHudMsg(id, g_HudSyncObj, "HP %d ", iHealth)
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1036\\ f0\\ fs16 \n\\ par }
*/
And who made ​​this hudspeed.sma displays the speed but you must say a bind.
I would like to display the life automatically without typing bind.

Code:
/*******************************************************************************
AMX Speed


Author: KRoTaL
Port : Claw (GraffityMaster)
Version: 0.2

0.1    Release
0.2    Dead players can see the speed of the player they are spectating


Shows your current speed, max speed, max ground speed.
You can also see players max ground speeds, to check if one has a speed hack.


Commands:

say /speed    -   switches the display of the speed info
say speed    -   switches the display of the speed info

say_team /speed    -   switches the display of the speed info
say_team speed    -   switches the display of the speed info

amx_showspeed   -   shows the max speed of connected players (admin only)
say speedadmin - shows the max speed of connected players (admin only)


Setup:

Install the amxx file.
Enable Engine.


*******************************************************************************/

#include <amxmodx>
#include <amxmisc>
#include <engine>


new g_speed[33]
new g_maxGroundSpeed[33]
new g_maxSpeed[33]
new g_maxplayers

public plugin_init()
{
    register_plugin("Speed", "0.2", "KRoTaL / GraffityMaster")
    
    register_clcmd("say /spd", "speedSwitch")
    register_clcmd("say spd", "speedSwitch")
    
    register_clcmd("say_team spd", "speedSwitch")
    register_clcmd("say_team /spd", "speedSwitch")
    
    register_clcmd("amx_showspeed", "showSpeed", ADMIN_LEVEL_B, "- shows the max speed of connected players")
    
    register_clcmd("say speedadmin", "showSpeed", ADMIN_LEVEL_B, "- shows the max speed of connected players")
    
    set_task(0.1, "speedTask", 5875454, "", 0, "b")
    
    g_maxplayers = get_maxplayers()
}

public client_connect(id)
{
    g_speed[id] = 0
    g_maxSpeed[id] = 0
    g_maxGroundSpeed[id] = 0
}

public speedSwitch(id)
{
    g_speed[id] = 1 - g_speed[id]
    
    client_print(id, print_chat, "[AMXX] You have %s speedinfo!", g_speed[id] ? "enabled" : "disabled")
    return PLUGIN_CONTINUE
}

public showSpeed(id,level,cid)
{
    new plname[16]
    new players[32], inum, player
    new msg[512], len
    new i
    
    if(!cmd_access(id,level,cid,1))
        return PLUGIN_HANDLED
    
    
    len = format(msg, 511, "<body><pre>%-16.16s %s", "Player Name", "Max Ground Speed")
    
    get_players(players, inum)
    
    
    for(i = 0; i < inum; i++)
    {
        player = players[i]
        
        if(g_maxGroundSpeed[player])
        {
            plname[0] = '^0'
            
            get_user_name(player, plname, 15)
            
            len += format(msg[len], 511-len, "^n%-16.16s %i", plname, g_maxGroundSpeed[player])
        }
    }
    
    show_motd(id, msg, "Max Ground Speeds")
    
    return PLUGIN_HANDLED
}

public speedTask(param[])
{
    new i, j, speed
    new msg[128]
    
    for(i = 1; i <= g_maxplayers; i++)
    {
        if(!is_user_alive(i)) continue
        speed = get_speed(i)
        
        if(speed > g_maxSpeed[i])
            g_maxSpeed[i] = speed
        
        if(entity_get_int(i, EV_INT_flags) & FL_ONGROUND)
        {
            if(speed > g_maxGroundSpeed[i])
                g_maxGroundSpeed[i] = speed
        }
        
        format(msg, 127, " | %d SPD", speed, g_maxSpeed[i], g_maxGroundSpeed[i])
        set_hudmessage(255, 255, 0, 0.085, 0.75, 0, 1.0, 0.13, 0.1, 0.2, 2)
        
        if(g_speed[i])
            show_hudmessage(i, msg)
        
        for(j = 1; j <= g_maxplayers; j++)
        {
            if(!is_user_alive(j) && g_speed[j] && entity_get_int(j, EV_INT_iuser2) == i)
                show_hudmessage(j, msg)
            
        }
    }
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1036\\ f0\\ fs16 \n\\ par }
*/
I hope someone help me know
I thank you in advance
Attached Files
File Type: sma Get Plugin or Get Source (hudhp.sma - 503 views - 807 Bytes)
File Type: sma Get Plugin or Get Source (hudspeed.sma - 505 views - 3.4 KB)

Last edited by Saulius; 02-03-2013 at 20:45.
Saulius is offline
Send a message via MSN to Saulius
 



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 20:38.


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