Raised This Month: $ Target: $400
 0% 

Need help with defining...


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ReapinPark
New Member
Join Date: Mar 2013
Old 03-05-2013 , 12:39   Need help with defining...
Reply With Quote #1

So the problem is that I really can't define the next tags "name_player" and "ip_player" from the next text:

PHP Code:
    ColorChat(0GREEN"--------------------------- RESTART ---------------------------")
    
ColorChat(0GREEN"^x04Harta Curenta: ^x03%s ^x01| ^x04Jucatori: ^x03%d/%d",
            
current_mapplayersnummaxplayers)
    
ColorChat(0GREEN"Data si timpul: %s"timer)
    
ColorChat(0GREEN"Nick-ul tau: ^"%s^" - IP-ul tau: %s"name_playerip_player)
    
ColorChat(0GREEN"--------------------------- HF & GL ---------------------------"
What I want to do is making the autorround plugin give that message. Here is how it looks right now (only the 1st half of the plugin) :

PHP Code:
#include < amxmodx >

#define PLUGIN "AutoRRound"
#define VERSION "1.0"
#define AUTHOR "AXel"

#if defined _colorchat_included
  #endinput
#endif
#define _colorchat_included

enum Color
{
   
NORMAL 1// clients scr_concolor cvar color
   
GREEN// Green Color
   
TEAM_COLOR// Red, grey, blue
   
GREY// grey
   
RED// Red
   
BLUE// Blue
}

new const 
TeamName[][] =
{
   
"",
   
"TERRORIST",
   
"CT",
   
"SPECTATOR"
}

#define HUD_MESSAGES
#define MAX_COUNT 1

new g_Count

public plugin_init() 
{
   
register_pluginPLUGINVERSIONAUTHOR )
   
register_event"TextMsg""event_gamecomencing""a""2&#Game_C" )

   
register_event"HLTV""event_newround""a""1=0","2=0" )
   
state START_FUNCTION
}

public 
event_gamecomencing() g_Count 0

public event_newround() < BLOCK_FUNCTION > { }
public 
event_newround() < START_FUNCTION >
{
   if( 
g_Count++ == MAX_COUNT )
   {
      
server_cmd"sv_restart 1" )
      
#if defined HUD_MESSAGES
      
set_task1.0"show_messages" )
      
#endif
      
state BLOCK_FUNCTION
   
}
}

public 
show_messages()
{
    new 
current_map[32]
    
get_mapname(current_map31);

    new 
playersnum get_playersnum();
    new 
maxplayers get_maxplayers();

    new 
timer[32]
    
get_time("%m/%d/%Y - %H:%M:%S",timer,31);

    new 
name_player[32]
    
get_user_name(idname_player31);

    new 
ip_player[32]
    
get_user_ip(idip_player311);

    
ColorChat(0GREEN"--------------------------- RESTART ---------------------------")
    
ColorChat(0GREEN"^x04Harta Curenta: ^x03%s ^x01| ^x04Jucatori: ^x03%d/%d",
            
current_mapplayersnummaxplayers)
    
ColorChat(0GREEN"Data si timpul: %s"timer)
    
ColorChat(0GREEN"Nick-ul tau: ^"%s^" - IP-ul tau: %s"name_playerip_player)
    
ColorChat(0GREEN"--------------------------- HF & GL ---------------------------"

Last edited by ReapinPark; 03-05-2013 at 12:47.
ReapinPark is offline
zEEDu
Junior Member
Join Date: Jan 2013
Location: Vaasa, Finland
Old 03-05-2013 , 12:48   Re: Need help with defining...
Reply With Quote #2

PHP Code:
#include < amxmodx >

#define PLUGIN "AutoRRound"
#define VERSION "1.0"
#define AUTHOR "AXel"

#if defined _colorchat_included
  #endinput
#endif
#define _colorchat_included

enum Color
{
   
NORMAL 1// clients scr_concolor cvar color
   
GREEN// Green Color
   
TEAM_COLOR// Red, grey, blue
   
GREY// grey
   
RED// Red
   
BLUE// Blue
}

new const 
TeamName[][] =
{
   
"",
   
"TERRORIST",
   
"CT",
   
"SPECTATOR"
}

#define HUD_MESSAGES
#define MAX_COUNT 1

new g_Count

public plugin_init() 
{
   
register_pluginPLUGINVERSIONAUTHOR )
   
register_event"TextMsg""event_gamecomencing""a""2&#Game_C" )

   
register_event"HLTV""event_newround""a""1=0","2=0" )
   
state START_FUNCTION
}

public 
event_gamecomencing() g_Count 0

public event_newround() < BLOCK_FUNCTION > { }
public 
event_newround() < START_FUNCTION >
{
   if( 
g_Count++ == MAX_COUNT )
   {
      
server_cmd"sv_restart 1" )
      
#if defined HUD_MESSAGES
      
set_task1.0"show_messages" )
      
#endif
      
state BLOCK_FUNCTION
   
}
}

public 
show_messages(player)
{
    new 
current_map[32]
    
get_mapname(current_map31);

    new 
playersnum get_playersnum();
    new 
maxplayers get_maxplayers();

    new 
timer[32], name_player[32], ip_player[32]
    
get_time("%m/%d/%Y - %H:%M:%S",timer,31);
    
get_user_name(player,name_player,31)
    
get_user_ip(player,ip_player,31,1)


    
ColorChat(0GREEN"--------------------------- RESTART ---------------------------")
    
ColorChat(0GREEN"^x04Harta Curenta: ^x03%s ^x01| ^x04Jucatori: ^x03%d/%d",
            
current_mapplayersnummaxplayers)
    
ColorChat(0GREEN"Data si timpul: %s"timer)
    
ColorChat(0GREEN"Nick-ul tau: ^"%s^" - IP-ul tau: %s"name_playerip_player)
    
ColorChat(0GREEN"--------------------------- HF & GL ---------------------------"
__________________
PM for Private Work!

Scandinavian Gaming Association
zEEDu is offline
ReapinPark
New Member
Join Date: Mar 2013
Old 03-05-2013 , 13:12   Re: Need help with defining...
Reply With Quote #3

That won't hel, it will show the name and the ip of the server. I want it to show the name and the ip of every players thats on the server. For exemple if your nickname is Ghost and your IP is yy.yy.yyy, when the game autorestarts it will show you this: Nick-ul tau: Ghost - IP-ul tau: yy.yy.yyy . If my name is Park and my IP is xx.xx.xxx, it will show me Nick-ul tau: Park - IP-ul tau: xx.xx.xxx . And so on for each player on the server.


PHP Code:
public show_messages()
{
    new 
current_map[32]
    
get_mapname(current_map31);

    new 
playersnum get_playersnum();
    new 
maxplayers get_maxplayers();

    new 
timer[32]
    
get_time("%m/%d/%Y - %H:%M:%S",timer,31)


    new 
index get_user_index(); 


    new 
name_player[32]
    
get_user_name(indexname_player31)

    new 
ip_player[32]
    
get_user_ip(indexip_player311)


    
ColorChat(0GREEN"--------------------------- RESTART ---------------------------")
    
ColorChat(0GREEN"^x04Harta Curenta: ^x03%s ^x01| ^x04Jucatori: ^x03%d/%d",
            
current_mapplayersnummaxplayers)
    
ColorChat(0GREEN"Data si timpul: %s"timer)
    
ColorChat(0GREEN"Nick-ul tau: ^"%s^" - IP-ul tau: %s"name_playerip_player)
    
ColorChat(0GREEN"--------------------------- HF & GL ---------------------------"
Problem here(deleted all my other tries, can get the index work): new index = get_user_index()

Last edited by ReapinPark; 03-05-2013 at 16:07.
ReapinPark is offline
Old 03-06-2013, 14:29
ReapinPark
This message has been deleted by YamiKaitou. Reason: wait 14 days before you bump
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 21:48.


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