[REZOLVAT]Cerere Modificare Plugin Mesaj de intampinare la s

Modificari necesare ale pluginurilor

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Post Reply
Natsu1997
Membru, skill 0
Membru, skill 0
Posts: 12
Joined: 05 Aug 2014, 13:28
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com...!
Detinator server CS: ZMx.IlegalZone.Ro
SteamID: ady_zada
Fond eXtream: 0
Location: Zadareni
Has thanked: 3 times
Contact:

17 Aug 2014, 13:26

Descriere plugin cerut : Vreau sa modificati urmatorul plugin ca toti jucatorii sa vada mesajul nu doar cel care se conecteaza sa il vada si sa faceti sa ramana mesajul 7 secunde caci apare pentru jumate de secunda si dispare rapid fara sa ai timp sa il citesti.

Alte informatii: SMA mai jos

Code: Select all

#include <amxmodx>

static const forumurl[] = "http://ilegalzone.com/forum/"

#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"
}  

public plugin_init() 
{
    register_plugin("New Welcome Message ", "0.1", "RnL/edit xdNTz");

    register_cvar("new_welcome","1")

    register_cvar("amx_forum",forumurl);
}

public client_putinserver(id)
{
    set_task(5.0, "new_welcome", id)

}

public new_welcome(id)
{
  if (get_cvar_num("new_welcome"))
  {
    new name[32]
    get_user_name(id,name,31)
    set_hudmessage(0, 255, 0, -1.0, -1.0)
    show_hudmessage(id, " Salut %s^n Bun venit in carciuma noastra^n Distreaza-te!",name);
    ColorChat(id, GREEN,"Bun Venit %s^x03! Iti vom servii ceva de baut ^x03!",name);
    if(is_user_connecting(id))
    set_hudmessage(0, 255, 0, -1.0, -1.0)
    show_hudmessage(id, "Atentie! Betivul %s a intrat in carciuma!!!")
    

  }
}  


ColorChat(id, Color:type, const msg[], any:...)
{
    new message[256];

    switch(type)
    {
        case NORMAL: // clients scr_concolor cvar color
        {
            message[0] = 0x01;
        }
        case GREEN: // Green
        {
            message[0] = 0x04;
        }
        default: // White, Red, Blue
        {
            message[0] = 0x03;
        }
    }

    vformat(message[1], 251, msg, 4);

    // Make sure message is not longer than 192 character. Will crash the server.
    message[192] = '^0';

    new team, ColorChange, index, MSG_Type;
    
    if(id)
    {
        MSG_Type = MSG_ONE_UNRELIABLE;
        index = id;
    } else {
        index = FindPlayer();
        MSG_Type = MSG_BROADCAST;
    }
    
    team = get_user_team(index);
    ColorChange = ColorSelection(index, MSG_Type, type);

    ShowColorMessage(index, MSG_Type, message);
        
    if(ColorChange)
    {
        Team_Info(index, MSG_Type, TeamName[team]);
    }
}

ShowColorMessage(id, type, message[])
{
    static msgSayText;
    if(!msgSayText)
    {
        msgSayText = get_user_msgid("SayText");
    }
    message_begin(type, msgSayText, _, id);
    write_byte(id)        
    write_string(message);
    message_end();    
}

Team_Info(id, type, team[])
{
    static msgTeamInfo;
    if(!msgTeamInfo)
    {
        msgTeamInfo = get_user_msgid("TeamInfo");
    }
    message_begin(type, msgTeamInfo, _, id);
    write_byte(id);
    write_string(team);
    message_end();

    return 1;
}

ColorSelection(index, type, Color:Type)
{
    switch(Type)
    {
        case RED:
        {
            return Team_Info(index, type, TeamName[1]);
        }
        case BLUE:
        {
            return Team_Info(index, type, TeamName[2]);
        }
        case GREY:
        {
            return Team_Info(index, type, TeamName[0]);
        }
    }

    return 0;
}

FindPlayer()
{
    new i = -1;

    while(i <= get_maxplayers())
    {
        if(is_user_connected(++i))
            return i;
    }

    return -1;
}  
Last edited by Cosmin on 18 Aug 2014, 21:42, edited 1 time in total.
Reason: marcat ca rezolvat
Image
ImageImageImage
Image
RoyalServer
User avatar
cyby
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 1777
Joined: 16 Jul 2011, 21:46
Detinator Steam: Da
Detinator server CS: Da
Reputatie: Scripter eXtreamCS
Fost Moderator ajutator
Has thanked: 146 times
Been thanked: 396 times

17 Aug 2014, 14:20

| Afiseaza codul
#include <amxmodx>

new g_msg_saytext, g_sync_msg, cvar_message, cvar_forum;

static const forumurl[] = "http://ilegalzone.com/forum/"

public plugin_init() 
{
	register_plugin("New Welcome Message ", "0.1", "RnL/edit xdNTz");

	cvar_message = register_cvar("amx_welcomemsg", "1")
	cvar_forum = register_cvar("amx_forummsg", "0")
	
	g_msg_saytext = get_user_msgid("SayText");
	g_sync_msg = CreateHudSyncObj();
}

public client_putinserver(id)
{
	if(!get_pcvar_num(cvar_message))
		return;
		
	set_task(5.0, "new_welcome", id)
}

public new_welcome(id)
{
	static name[32], forum[32];
	get_user_name(id, name, charsmax(name) - 1)
	set_hudmessage(0, 250, 0, -1.0, -1.0, 0, 6.0, 6.0)
	if(get_pcvar_num(cvar_forum))
		formatex(forum, charsmax(forum), "^nForumul nostru este: %s", forumurl)
		
	ShowSyncHudMsg(0, g_sync_msg, "Salut %s^n Bun venit in carciuma noastra^nDistreaza-te!%s", name, forum)
	color(0, ".vBun venit.e %s.v! Iti vom servi ceva de baut!.g", name)
}

stock color(const id, const input[], any:...)
{
	new count = 1, players[32];
	static msg[191]
	vformat(msg, 190, input, 3)
	
	replace_all(msg, 190, ".v", "^4")
	replace_all(msg, 190, ".g", "^1")
	replace_all(msg, 190, ".e", "^3")
	
	if(id) players[0] = id; else get_players(players, count, "ch")
	{
		for (new i = 0; i < count; i++)
		{
			if(is_user_connected(players))
			{
				message_begin(MSG_ONE_UNRELIABLE, g_msg_saytext, _, players)
				write_byte(players)
				write_string(msg)
				message_end()
			}
		}
	}
}
93.114.82.17:27015 - Monster Invasion CO-OP Mod
Natsu1997
Membru, skill 0
Membru, skill 0
Posts: 12
Joined: 05 Aug 2014, 13:28
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com...!
Detinator server CS: ZMx.IlegalZone.Ro
SteamID: ady_zada
Fond eXtream: 0
Location: Zadareni
Has thanked: 3 times
Contact:

18 Aug 2014, 10:42

Code: Select all

Welcome to the AMX Mod X 1.60-300 Compiler.
Copyright (c) 1997-2005 ITB CompuPhase, AMX Mod X Team

Error: Undefined symbol "CreateHudSyncObj" on line 15 -
Error: Undefined symbol "get_pcvar_num" on line 20 -
Error: Undefined symbol "charsmax" on line 29 -
Error: Undefined symbol "get_pcvar_num" on line 31 -
Error: Undefined symbol "formatex" on line 32 -
Error: Undefined symbol "ShowSyncHudMsg" on line 34 -
Warning: Tag mismatch on line 35
Error: Undefined symbol "vformat" on line 42 -
Error: Undefined symbol "replace_all" on line 44 -
Error: Undefined symbol "replace_all" on line 45 -
Error: Undefined symbol "replace_all" on line 46 -
Warning: Symbol is assigned a value that is never used: "cvar_forum" on line 61
Warning: Symbol is assigned a value that is never used: "cvar_message" on line 61
Warning: Symbol is assigned a value that is never used: "g_sync_msg" on line 61

10 Errors.
Could not locate output file C:\PC jocuri\ADRI\AMX Mod X\amxxstudio\welcome_message.amx (compile failed).
Ce include am nevoie sa compilez? Sau imi trebuie o alta versiune a AMX Mod X ?
Image
ImageImageImage
Image
User avatar
cyby
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 1777
Joined: 16 Jul 2011, 21:46
Detinator Steam: Da
Detinator server CS: Da
Reputatie: Scripter eXtreamCS
Fost Moderator ajutator
Has thanked: 146 times
Been thanked: 396 times

18 Aug 2014, 11:53

Pune codul sursa aici si dai compile. Apoi descarca fisierul compilat.
93.114.82.17:27015 - Monster Invasion CO-OP Mod
Cosmin
Fost moderator
Fost moderator
Posts: 9362
Joined: 06 Jul 2013, 22:08
Detinator Steam: Da
Detinator server CS: Nu
Reputatie: Fost eXtream Mod
Fost Scripter eXtreamCS
Nume anterior: scosmynnnn
Has thanked: 492 times
Been thanked: 547 times

18 Aug 2014, 15:21

@mutat in sectiunea corespunzatoare
Natsu1997
Membru, skill 0
Membru, skill 0
Posts: 12
Joined: 05 Aug 2014, 13:28
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com...!
Detinator server CS: ZMx.IlegalZone.Ro
SteamID: ady_zada
Fond eXtream: 0
Location: Zadareni
Has thanked: 3 times
Contact:

18 Aug 2014, 21:38

Am uitat ca aveti categorie pentru a schimba pluginuri, multumesc pentru mutare.
Multumesc de plugin, functioneaza cum am vrut, TC.
Image
ImageImageImage
Image
Post Reply

Return to “Modificari pluginuri”

  • Information