AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Need help (https://forums.alliedmods.net/showthread.php?t=164586)

3.14 zdec 08-13-2011 09:38

Need help
 
1 Attachment(s)
I need this plugin to show info to teammates.
Please help.
Code:

#include <amxmodx>
#include <cstrike>
#include <csx>

#pragma semicolon 1

new g_FriendOnly;

public plugin_init( )
{
        register_plugin("Player Info", "0.1", "3.14 zdec");
       
        g_FriendOnly = register_cvar("aim_friendonly", "1");
       
        register_event("StatusValue", "EventStatusValue", "b", "1>0", "2>0");
}

public EventStatusValue(const id)
{
        new sName[32], sWpnName[32], iClip, iAmmo, iType = read_data(1), iData = read_data(2);
        new iWpnID = get_user_weapon(iData, iClip, iAmmo);
        get_user_name(iData, sName, 31);

        if(iWpnID)
        {
                xmod_get_wpnname(iWpnID, sWpnName, 31);
        }
       
        if(iType == 3 || !g_FriendOnly && iType == 1) return;

        if(cs_get_user_team(iData) == CS_TEAM_T)
        {
                set_hudmessage(255, 0, 0, -1.0, 0.59, 0, 2.0, 2.0);
                show_hudmessage(id,"%s ^nHealth: %d ^nArmor: %d ^nWeapon: %s", sName, get_user_health(iData), get_user_armor(iData), sWpnName);
        }
        if(cs_get_user_team(iData) == CS_TEAM_CT)
        {
                set_hudmessage(0, 128, 255, -1.0, 0.59, 0, 2.0, 2.0);
                show_hudmessage(id,"%s ^nHealth: %d ^nArmor: %d ^nWeapon: %s", sName, get_user_health(iData), get_user_armor(iData), sWpnName);
        }
}


Backstabnoob 08-13-2011 11:17

Re: Need help
 
cs_get_user_team(iData) == CS_TEAM_T

change to

cs_get_user_team(iData) == cs_get_user_team(id)

delete the second check and then change the colors

3.14 zdec 08-13-2011 15:26

Re: Need help
 
Thanks much, for your help.
But i still misunderstand, how to make two colours in one check.
Please, could you tell me more clearly?


All times are GMT -4. The time now is 03:19.

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