Raised This Month: $51 Target: $400
 12% 

Double Messages


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Obada
Senior Member
Join Date: Dec 2014
Location: Abu Dhabi
Old 02-16-2015 , 09:56   Double Messages
Reply With Quote #1

Hey there,


Here is the vote function in my adminvote.sma.

Spoiler


It's working and everything is fine, but the problem is that if a Golden Player/Silver player made custom vote, it will print like


Thank you, and help is appreciated!
Obada is offline
Flick3rR
Veteran Member
Join Date: Feb 2014
Location: Bulgaria, Stara Zagora
Old 02-16-2015 , 09:59   Re: Double Messages
Reply With Quote #2

Well, first you have 3 if-else statements, where 1 message is printed. And then you have that loop and print another message. I don't really see the purpose, but yes - that's what the code is supposed to make.
__________________
Flick3rR is offline
Send a message via Skype™ to Flick3rR
Obada
Senior Member
Join Date: Dec 2014
Location: Abu Dhabi
Old 02-16-2015 , 10:18   Re: Double Messages
Reply With Quote #3

Then do you have any idea how can I make it print once?
Obada is offline
Flick3rR
Veteran Member
Join Date: Feb 2014
Location: Bulgaria, Stara Zagora
Old 02-16-2015 , 10:26   Re: Double Messages
Reply With Quote #4

PHP Code:
new maxpl=get_maxplayers(); 
    new 
msg[256]; 
    for (new 
1<= maxpli++) 
    { 
        if (
is_user_connected(i) && !is_user_bot(i)) 
            { 
            
// HACK: ADMIN_VOTE_CUS_{1,2} keys were designed very poorly.  Remove all : and %s in it. 
            
LookupLangKey(msgcharsmax(msg), "ADMIN_VOTE_CUS_1"i); 
            
replace_all(msgcharsmax(msg), "%s"""); 
            
replace_all(msgcharsmax(msg), ":"""); 
            
trim(msg); 
            
show_activity_id(iidnamemsg); 
        } 
    } 
to
PHP Code:
else
    {
        new 
maxpl=get_maxplayers(); 
        new 
msg[256]; 
        for (new 
1<= maxpli++) 
        { 
            if (
is_user_connected(i) && !is_user_bot(i)) 
            { 
                
// HACK: ADMIN_VOTE_CUS_{1,2} keys were designed very poorly.  Remove all : and %s in it. 
                
LookupLangKey(msgcharsmax(msg), "ADMIN_VOTE_CUS_1"i); 
                
replace_all(msgcharsmax(msg), "%s"""); 
                
replace_all(msgcharsmax(msg), ":"""); 
                
trim(msg); 
                
show_activity_id(iidnamemsg); 
            } 
        }
    } 
__________________
Flick3rR is offline
Send a message via Skype™ to Flick3rR
Obada
Senior Member
Join Date: Dec 2014
Location: Abu Dhabi
Old 02-16-2015 , 11:06   Re: Double Messages
Reply With Quote #5

Alright thanks man.
Obada is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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