AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Galileo - VIP (https://forums.alliedmods.net/showthread.php?t=188994)

gump497 07-02-2012 13:45

Galileo - VIP
 
Hello,
I need to do such a text to write to all but there will be VIP ...

Screen: http://bluegame.sk/vip.png

English:

[VIP] "Nick" voted for the map name_map. The vote is due in 2 VIP advantages
"Nick2" has choosen "name_map".

I knew someone would do that Galileo or just write code and I'll get it there?

Thanks for any response

Liverwiz 07-02-2012 15:42

Re: Galileo - VIP
 
PHP Code:

new g_saytext
// plugin_init
register_clcmd("say""handleSay")
g_saytext get_user_msgid("SayText")

public 
handleSay(id)
{
    if(
isVIP(id) )
    {
        new 
input[192]; read_args(inputcharsmax(input) )
        
remove_quotes(input)
        new 
output[224], name[32]
        
formatex(outputcharsmax(output), "^x04[VIP] ^x03%s^x01: %s"nameinput)

            
// for loop to go through each player in the server
        
message_begin(MSG_ONEg_saytext, {0,0,0}, player)
        
write_byte(player)
        
write_string(output)
        
message_end()
    }
    return 
PLUGIN_HANDLED_MAIN


That's a bit incomplete, as a few bugs will arise at run time. But its enough to get you started.
NOTE: you'll have to put the message code message_begin to message_end within a for loop so you can loop through all the players and print the message to them individually. IMPORTANT! messages CAN NOT be sent server-wide (id 0), or the server will crash.

Sorry for incomplete, but i'm lazy. And it wouldn't be fun if i gave you ALL the answers, would it?

gump497 07-02-2012 16:07

Re: Galileo - VIP
 
Yes :D, but you poorly understood me. Need to do the Galileo code to this text: ***[VIP] "Nick" voted for the map name_map. The vote is due in 2 VIP advantages*** wrote all. And nick VIP player will be written in the text + there will be the name of the map and double vote.


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

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