AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Where is the error (https://forums.alliedmods.net/showthread.php?t=76745)

Tester23 08-29-2008 17:20

Where is the error
 
Code:

new maxplayers
new gmsgSayText

public plugin_init() {
    register_plugin("Contacto", "1.00", "Moke")
        register_clcmd("say /admin" , "contacto")

public contacto(id)

{    new message[124]

 
  console_print(id, print_chat,"^x04[hns]^ Abierta la inscripcion de nuevos adms : ^[email protected]^")
 
}

Where is the error i can find it

anakin_cstrike 08-29-2008 17:22

Re: Where is the error
 
You can't print colored messages in chat with client_print, use format/formatex...ori look in ColorChat.sma.
Also, you don't need the cstrike and fun module if thats the full code

Tester23 08-29-2008 19:04

Re: Where is the error
 
Code:

public contacto(id)

{    new message[124]

 
  format (id, print_chat,"^x04[hns]^ Abierta la inscripcion de nuevos adms : ^x03aiasdsaar^")
  print_message(id,message)

Like this way i coudnt find any tutorial of format/formatext

v3x 08-29-2008 19:18

Re: Where is the error
 
Try this. I created a function for the SayText message.
PHP Code:

#include <amxmodx>

new maxplayers
new gmsgSayText

public plugin_init()
{
    
register_plugin("Contacto""1.00""Moke")
    
register_clcmd("say /admin""contacto")

    
maxplayers get_maxplayers()

    
gmsgSayText get_user_msgid("SayText")
}

public 
contacto(id)
{
    
SayText(id"^x04[hns] Abierta la inscripcion de nuevos adms : ^[email protected]")

    return 
PLUGIN_CONTINUE
}

SayTextid message[] , any:... )
{
    if( 
id > ( maxplayers ) )
        return 
0

    
if( id && ( !is_user_aliveid ) || is_user_botid ) ) ) 
        return 
0

    
static msg[252]
    
vformatmsg[1] , 251 message );

    if( !
id )
    {
        for( new 
0maxplayersi++ )
        {
            if( !
is_user_connected) || is_user_bot) ) continue

            
message_beginMSG_ONE gmsgSayText , {0,0,0} , id )
            
write_byteid )
            
write_stringmessage )
            
message_end()
        }
    }
    else
    {
        
message_beginMSG_ONE gmsgSayText , {0,0,0} , id )
        
write_byteid )
        
write_stringmessage )
        
message_end()
    }

    return 
1




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

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