AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Problem with ScoreAttrib (https://forums.alliedmods.net/showthread.php?t=83539)

Speed! 01-11-2009 10:18

Problem with ScoreAttrib
 
I am tryng to put the VIP con a specified player
i just use

PHP Code:

    message_begin(MSG_BROADCASTg_msgScoreAttrib)
    
write_byte(id// id
    
write_byte(4// attrib
    
message_end() 

But sometimes it just shows, sometimes it not, and sometimes when most people is dead it shows :S
I'd apologize your help. I don't speak english OK at all

ConnorMcLeod 01-11-2009 10:30

Re: Problem with ScoreAttrib
 
You also have to register the event, and resend the message each time the event is fired with this player id.
Or register the message and change the 2nd arg when 1rst arg = id.

Speed! 01-11-2009 18:30

Re: Problem with ScoreAttrib
 
the message is registered
i will show you how it works (it doesent at all LOL)
i am using it with zombie plague. when a nemesis/survivor is made, it calls the function zombieme/humanme. I did added to that function a task with 1sec delay calling this:

PHP Code:

public fnCheckVIP()
{
    static 
id
    
for (id 1id <= g_maxplayersid++)
    {
        
// Last zombie
        
if ((g_zombie[id] && is_user_alive(id)) || (g_zombie[id] && is_user_alive(id)))
            
make_vip(id)

    }


PHP Code:

make_vip(id)
{
    
message_begin(MSG_BROADCASTg_msgScoreAttrib)
    
write_byte(id// id
    
write_byte(4// attrib
    
message_end()


I dont really know what is happening. Also i did searched for this message being called in this plugin, and it isnt at all. Allthough now im thinking if one plugin that i am using (one wich prevents from appearing as dead an playing those players who are downloading models or any stuff) may be interfering.

Sn!ff3r 01-11-2009 18:31

Re: Problem with ScoreAttrib
 
Replace MSG_BROADCAST to MSG_ALL.

ConnorMcLeod 01-12-2009 00:21

Re: Problem with ScoreAttrib
 
Quote:

Originally Posted by Sn!ff3r (Post 742460)
Replace MSG_BROADCAST to MSG_ALL.

Won't help.

ConnorMcLeod 01-12-2009 00:30

Re: Problem with ScoreAttrib
 
This 100% works :

PHP Code:

#include <amxmodx>
#include <fakemeta>


#define SCOREATTRIB_VIP            (1<<2)

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)

    
register_message(get_user_msgid("ScoreAttrib"), "Hook_ScoreAttrib")
}

public 
Hook_ScoreAttrib(osef2talifeosef3talifeosef4talife)
{
    new 
id get_msg_arg_int(1)

    if(!
g_bIsAdmin[id]) // replace this with the appropriate check on id
        
return

/*    if( !get_msg_arg_int(2) ) // player is alive
    {
        set_pdata_int(id, OFFSET_INTERNALMODEL, CS_CT_VIP)
        dllfunc(DLLFunc_ClientUserInfoChanged, id)
    }*/ // this actually sets the vip skin, but you don't want it

    
set_msg_arg_int(2ARG_BYTESCOREATTRIB_VIP)



hleV 01-12-2009 05:19

Re: Problem with ScoreAttrib
 
Is it possible so CTs will see a T as 'VIP' while Ts will see that player as Bomb?

Sn!ff3r 01-12-2009 09:59

Re: Problem with ScoreAttrib
 
Quote:

T as 'VIP'
No.

Speed! 01-12-2009 17:03

Re: Problem with ScoreAttrib
 
i havent tried it yet, but anyway, thnks to all for helping :D

EDIT: It doesent work at all O.o its a bit odd now, like if it is makin appear as VIP randomly lol

Speed! 01-12-2009 18:46

Re: Problem with ScoreAttrib
 
i think to know why it doesent work at all... a nemesis is done in the middle of the round. i guess that the message isnt called.


All times are GMT -4. The time now is 01:48.

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