AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [Solved] Bug StatusIcon xD (https://forums.alliedmods.net/showthread.php?t=243107)

Jhob94 06-29-2014 17:20

[Solved] Bug StatusIcon xD
 
I am using statusicon msg to display the amount of lasermines i have.
It happens this after install lasermines :3

http://cloud-4.steampowered.com/ugc/...5.resizedimage

Code:
PHP Code:

public update_lmmsg(id)
{
    if(
is_user_connected(id) && !is_user_bot(id))
    {
        
update_finalmsg(id0)
        
update_finalmsg(idis_user_alive(id) ? 0)
    }
}

public 
update_finalmsg(idonoff)
{
    static 
LMSprites[33]
    
format(LMSpritessizeof(LMSprites), "number_%d"g_havemine[id])
    
    
message_begin(MSG_ONE_UNRELIABLEg_Msg_StatusIcon, {0,0,0}, id)
    
write_byte(onoff)
    
write_string(LMSprites)
    
write_byte(42// red
    
write_byte(212// green
    
write_byte(255// blue
    
message_end()



Freezo Begin 06-29-2014 17:25

Re: Bug StatusIcon xD
 
i don't get is
PHP Code:

update_finalmsg(id0)
update_finalmsg(idis_user_alive(id) ? 0

if i'm not right the second is sufficient ? you don't have to set the first !

Jhob94 06-29-2014 17:32

Re: Bug StatusIcon xD
 
Quote:

Originally Posted by Freezo Begin (Post 2159441)
i don't get is
PHP Code:

update_finalmsg(id0)
update_finalmsg(idis_user_alive(id) ? 0

if i'm not right the second is sufficient ? you don't have to set the first !

The first i made because of the bug. Thought maybe it could fix it, didnt fixed..

Freezo Begin 06-29-2014 17:37

Re: Bug StatusIcon xD
 
post the whole code ! i think the problem isn't from here maybe there's a bool to check planting lm and you forget to check it !

Jhob94 06-29-2014 17:39

Re: Bug StatusIcon xD
 
Quote:

Originally Posted by Freezo Begin (Post 2159447)
post the whole code !

If i havent posted whole code is because i havent authorization to do it.
Also, i guess the problem is here, nothing else in code touch this message.

YamiKaitou 06-29-2014 19:53

Re: Bug StatusIcon xD
 
So you only want 1 number to be shown at a time? Where are you telling it to hide the previous icons? You keep telling it to display a new one but never hide the old one. So, you need to send the message twice. Once for the previous icon to hide it and then again for the new icon to show it

Quote:

Originally Posted by Jhob94 (Post 2159450)
If i havent posted whole code is because i havent authorization to do it.

As long as you have the code, you have authorization to do whatever you want with it. Nobody can prevent you from distributing it

Jhob94 06-30-2014 18:03

Re: Bug StatusIcon xD
 
Quote:

Originally Posted by YamiKaitou (Post 2159493)
So you only want 1 number to be shown at a time? Where are you telling it to hide the previous icons? You keep telling it to display a new one but never hide the old one. So, you need to send the message twice. Once for the previous icon to hide it and then again for the new icon to show it

I realized it yesterday xD
But thanks :)


Quote:

Originally Posted by YamiKaitou (Post 2159493)
As long as you have the code, you have authorization to do whatever you want with it. Nobody can prevent you from distributing it

I know, but i meant, its something private for the team in cause. I dont want to leak it out since is a big edit of the lasermines plugin.

meTaLiCroSS 06-30-2014 22:58

Re: [Solved] Bug StatusIcon xD
 
Anyway..

PHP Code:

public update_lmmsg(id)
{
    if(
is_user_connected(id) && !is_user_bot(id))
    {
        
update_finalmsg(idg_havemine[id] + 10// deleting the previous num
        
update_finalmsg(idg_havemine[id], is_user_alive(id) ? 0// set the current num
    
}
}

public 
update_finalmsg(idnumberonoff)
{
    static 
LMSprites[33]
    
format(LMSpritessizeof(LMSprites), "number_%d"number)
    
    
message_begin(MSG_ONE_UNRELIABLEg_Msg_StatusIcon, {0,0,0}, id)
    
write_byte(onoff)
    
write_string(LMSprites)
    
write_byte(42// red
    
write_byte(212// green
    
write_byte(255// blue
    
message_end()




All times are GMT -4. The time now is 21:06.

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