AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [HELP] Cant under stand (https://forums.alliedmods.net/showthread.php?t=308297)

soumyadip77 06-15-2018 05:32

[HELP] Cant under stand
 
i cant under stand this plugin
PHP Code:

#include <amxmodx>
#include <reapi>

#define PLUGIN     "resetscore(ReAPI)"
#define VERSION "1.0"
#define AUTHOR  "Phantom"

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR);
    
register_clcmd("say /rs""resetscore"); register_clcmd("say_team /rs""resetscore");
}

public 
resetscore(id) {
    if(!
is_user_connected(id)) return;

    
set_entvar(idvar_frags0.0);
    
set_member(idm_iDeaths0);

    
message_begin(MSG_ONE_UNRELIABLE76, .player id);
    
write_byte(id);
    
write_string("^1Счет обнулен");
    
message_end();

    
message_begin(MSG_ALL85);
    
write_byte(id);
    
write_short(0); write_short(0); write_short(0); write_short(0);
    
message_end();


this part
PHP Code:

message_begin(MSG_ONE_UNRELIABLE76, .player id);
    
write_byte(id);
    
write_string("^1Счет обнулен");
    
message_end();

    
message_begin(MSG_ALL85);
    
write_byte(id);
    
write_short(0); write_short(0); write_short(0); write_short(0);
    
message_end(); 

what is the work of this ^

instinctpt1 06-15-2018 06:41

Re: [HELP] Cant under stand
 
You can do this via client_print_color too
This part is just writing a string

soumyadip77 06-15-2018 07:22

Re: [HELP] Cant under stand
 
tis parta
PHP Code:

message_begin(MSG_ALL85); 
    
write_byte(id); 
    
write_short(0); write_short(0); write_short(0); write_short(0); 
    
message_end(); 


E1_531G 06-15-2018 07:41

Re: [HELP] Cant under stand
 
It seems to be the ScoreInfo message.

CrazY. 06-15-2018 08:34

Re: [HELP] Cant under stand
 
Poorly indented. You did something wrong, since the "85" doesn't exists in message_const.inc and in Half-Life 1 Game Events it means "ItemStatus" event.
https://wiki.alliedmods.net/Half-Lif...nts#ItemStatus

If you want to update the Scoreboard, better work with user message "ScoreInfo".
https://wiki.alliedmods.net/Half-Lif...ents#ScoreInfo


All times are GMT -4. The time now is 04:37.

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