AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   write_short money (https://forums.alliedmods.net/showthread.php?t=340129)

Nutu_ 10-27-2022 08:38

write_short money
 
I'm using this
PHP Code:

public UpdateFrags(id){
    if(!
is_user_connected(id)){
        return;
    }      
    
set_pev(idpev_fragsgKillerPointsid ]);
    
message_begin(MSG_BROADCASTget_user_msgid("ScoreInfo"));
    
write_byte(id);
    
write_short(gKillerPointsid ]);
    
write_short(cs_get_user_deaths(id));
    
write_short(0);
    
write_short(1);
    
message_end();
}

public 
Event_ScoreInfo(){
    
UpdateFrags(read_data(1));


to change the kills into points, what i want to do is edit this and change the "Money" into points (in scoreboard) i searched but didnt found, i'd like the frags to be back and move the points to "Money" (in scoreboard)!
anyone? thanks

Natsheh 10-27-2022 18:05

Re: write_short money
 
PHP Code:


public plugin_init()
{
    
register_message(get_user_msgid("Account"), "fw_message_account");
}

public 
fw_message_account(msgiddestid)
{
    const 
ARG_USER_ACCOUNT 1;
    const 
ARG_ACCOUNT_VALUE 2;
    const 
MSGID_ACCOUNT_MAX_ARGS 2;
    if(
get_msg_args() >= MSGID_ACCOUNT_MAX_ARGS)
    {
        if(
get_msg_argtype(ARG_ACCOUNT_VALUE) == ARG_LONG)
        {
            if(
get_msg_arg_int(ARG_ACCOUNT_VALUE) > -1set_msg_arg_int(ARG_ACCOUNT_VALUEARG_LONGgKillerPoints[clamp(get_msg_arg_int(ARG_USER_ACCOUNT), 1MAX_PLAYERS)]);
        }
    }



Nutu_ 10-28-2022 10:03

Re: write_short money
 
thanks, it works!


All times are GMT -4. The time now is 15:36.

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