welcome message plugin

Categoria cu cereri de pluginuri si nu numai.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Forum rules
Accesează link-ul pentru a putea vedea regulile forumului

Daca doriti sa vi se modifice un plugin, va rugam postati aici .
Post Reply
User avatar
FizZle
Membru, skill +4
Membru, skill +4
Posts: 1622
Joined: 17 Jan 2015, 19:33
Detinator Steam: Da
Detinator server CS: da
SteamID: berserknorse
Fond eXtream: 0
Location: Iasi
Has thanked: 21 times
Been thanked: 26 times
Contact:

02 Nov 2018, 14:50

cand vreau sa-l rulez imi da eroarea asta :

Code: Select all

/tmp/text2h7mS4.sma(12) : fatal error 100: cannot read from file: "colorchat"
| Afiseaza codul
/*---------------------------------------------------------------------------
 |                  Welcome Message (v1.2)  © 2011                           |
 |                                                                           |
 |              Plugin by Dusan (Uncut*) Stojadinovic                        |
 |                                                                           |
 |     Made 28. III 2011.             Contact - [email protected].           |
 --------------------------------------------------------------------------*/


#include <amxmodx>
#include <amxmisc>
#include <colorchat>

#define PLUGIN "Welcome msg"
#define VERSION "1.2"
#define AUTHOR "Uncut*"


new gprefix, auto, server


public plugin_init() {
    
    register_plugin(PLUGIN, VERSION, AUTHOR)
    register_cvar("welcomemsg", "1.2" , (FCVAR_SERVER|FCVAR_SPONLY))
    register_cvar("uncut", "1.0" , (FCVAR_SERVER|FCVAR_SPONLY))

    gprefix = register_cvar("amx_connect_prefix", "CS.ESTRIKE.RO")
    auto = register_cvar("amx_connect_auto", "1")
    server = register_cvar("amx_connect_server", "Ime servera")

 
}
public client_putinserver(id){
    set_task(2.0, "poruka", id, _, _, "a", 1)
}
public poruka(id){
    new Ime[32]
    get_user_name(id, Ime[id], 31)
        
    static prefix[10]
    get_pcvar_string(gprefix, prefix, 9)
        
    new hostname[55]
    get_pcvar_string((get_cvar_pointer("CS.ESTRIKE.RO")), hostname, 54)
        
    new pserver[41]
    get_pcvar_string(server, pserver, 40)
        
        
    if(get_pcvar_num(auto) == 0)
        ColorChat(id ,RED, "^x04[Estrike]^x01 Jucatorul ^x03 %s ^x01 , s-a conectat pe ^x03 %s ^x01 | ^x04Bafta la fraguri^x01", prefix, Ime[id], pserver )
    else
        ColorChat(id ,RED, "^x04[Estrike]^x01 Jucatorul ^x03 %s ^x01 , s-a conectat pe^x03 %s ^x01 | ^x04Bafta la fraguri^x01", prefix, Ime[id], hostname )
        
        
    return PLUGIN_HANDLED
}
RoyalServer 2
User avatar
Laurentiu P.
Fost moderator
Fost moderator
Posts: 2549
Joined: 10 Jul 2013, 21:26
Detinator Steam: Da
Reputatie: Fost super moderator
Fond eXtream: 100
Has thanked: 26 times
Been thanked: 62 times
Contact:

03 Nov 2018, 08:19

no...
User avatar
LondoN eXtream
Membru eXtream
Membru eXtream
Posts: 2755
Joined: 10 Oct 2014, 06:21
Detinator Steam: Da
SteamID: /id/london_extreamcs
Reputatie: Fost scripter eXtreamCS
Fost moderator ajutator
Membru Club eXtreamCS (6 luni)
Fond eXtream: 0
Location: Roman, Neamț
Has thanked: 3 times
Been thanked: 12 times

03 Nov 2018, 12:31

Nu e deloc bun acest cod. Foloseste altul. Parerea mea
BiNECUVANTAT
Membru, skill 0
Membru, skill 0
Posts: 30
Joined: 04 Nov 2018, 16:40
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Has thanked: 2 times
Contact:

04 Nov 2018, 16:49

Compilatorul ce il folosesti nu are acel include..iti pot da eu un plugin bun de welcome message daca vrei.

Cod:

Code: Select all

//* Welcome Message with three colors by binecuvantatu//

#include <amxmodx>
#include <amxmisc>
#include <csx>
#include <csstats>
#include <nvault>
#include <dhudmessage>

#define PLUGIN "Welcome Message"
#define VERSION "1.0"
#define AUTHOR "Binecuvantatu"

new gTime[33]
new gVault
new hostname[64]


public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
	
	gVault = nvault_open("TIME")
}

public client_authorized(id)
{
	loaddata(id)
}

public client_disconnect(id)
{
	gTime[id] += get_user_time(id)
	savedata(id)
}

public client_putinserver(id)
{
	if(is_user_bot(id)) return
	
	set_task(10.0, "welcomeHUD", id)
	set_task(10.0, "hostHUD", id)
	set_task(5.0, "adminHUD", id)
}

public welcomeHUD(id)
{
	new stats[8], body[8], nick[32], hostname[64]
	
	new rank_pos = get_user_stats(id, stats, body)
	new rank_max = get_statsnum()
	get_user_name(id, nick, 31)
	get_cvar_string("hostname",hostname,63)
	new iTimeMins = gTime[id] / 60
	
	static Deaths = 0, Kills = 0, Float:Ratio = 0.0
	
	Deaths = stats[1], Kills = stats[0], Ratio = Deaths == 0 ? (float(Kills)) : (float(Kills) / float(Deaths))
	
	set_dhudmessage(0, 255, 0, 0.03, 0.30, 2, 6.0, 8.0 )
	show_dhudmessage(id, "Welcome, %s^nRank: %d of %d^nKills: %d Deaths: %d KPD: %.2f^nOnline: %i m^nEnjoY!", nick,rank_pos,rank_max,stats[0], stats[1], Ratio,iTimeMins)
}

stock savedata(id)
{
	new AuthId[65]
	get_user_authid(id, AuthId, charsmax(AuthId))
	
	new VaultKey[64], VaultData[256]
	format(VaultKey, 63, "%s-TIME", AuthId)
	format(VaultData, 254, "%i", gTime[id])
	
	nvault_set(gVault, VaultKey, VaultData)
	
	return PLUGIN_CONTINUE
}

stock loaddata(id)
{
	new AuthID[35] 
	get_user_authid(id,AuthID,charsmax(AuthID ))
	new vaultkey[64],vaultdata[256]
	
	format(vaultkey,63,"%s-TIME" ,AuthID) 
	format(vaultdata,255,"%i",gTime[id]) 
	
	nvault_get(gVault,vaultkey,vaultdata,charsmax (vaultdata))
	
	new Time[33]
	parse(vaultdata, Time, charsmax(Time))
	
	gTime[id] = str_to_num(Time)
}

public hostHUD(id)
{
          get_cvar_string("hostname", hostname, 63)

	set_dhudmessage(212, 42, 255, 0.03, 0.5, 2, 6.0, 10.0)
	show_dhudmessage(id, "%s^nDon't forget to add IP to your favourites!", hostname)
}

public adminHUD(id)
{
	if (is_user_admin(id))
	{
		set_dhudmessage(0, 255, 255, 0.03, 0.75, 2, 6.0, 3.0);
		show_dhudmessage(id, "You are now Administrator!");
	}
}

BB.ALPHACS.RO
User avatar
FizZle
Membru, skill +4
Membru, skill +4
Posts: 1622
Joined: 17 Jan 2015, 19:33
Detinator Steam: Da
Detinator server CS: da
SteamID: berserknorse
Fond eXtream: 0
Location: Iasi
Has thanked: 21 times
Been thanked: 26 times
Contact:

04 Nov 2018, 17:15

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

/tmp/text8TwZPT.sma(8) : fatal error 100: cannot read from file: "dhudmessage"
User avatar
Laurentiu P.
Fost moderator
Fost moderator
Posts: 2549
Joined: 10 Jul 2013, 21:26
Detinator Steam: Da
Reputatie: Fost super moderator
Fond eXtream: 100
Has thanked: 26 times
Been thanked: 62 times
Contact:

04 Nov 2018, 19:35

FizZle wrote:Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team

/tmp/text8TwZPT.sma(8) : fatal error 100: cannot read from file: "dhudmessage"

Aceeasi poveste, ai nevoie de include ``dhudmessage.inc``.
no...
User avatar
A k c 3 n 7
Super moderator
Super moderator
Posts: 5137
Joined: 25 Aug 2014, 21:31
Detinator Steam: Da
CS Status: who dares wins
SteamID: Jandarmeria
Reputatie: Super moderator
Moderatorul anului 2023
Fost Membru Club eXtreamCS ( o luna )
Fost eXtream Mod
Fost Intermediar
Nume anterior: Sorinel
Fond eXtream: 0
Location: Unknown
Discord: remusakcent
Has thanked: 4 times
Been thanked: 46 times

04 Nov 2018, 23:29

User avatar
dragonCSX
Membru, skill +1
Membru, skill +1
Posts: 281
Joined: 04 Feb 2017, 17:36
Detinator Steam: Da
CS Status: moneymaker.
Detinator server CS: xmas.arenadevils.ro
SteamID: csfweed01
Fond eXtream: 0
Location: Ploiesti
Discord: csfweed1337
Has thanked: 8 times
Been thanked: 6 times
Contact:

05 Nov 2018, 18:56

Cel mai bine se compilează local un plugin , online îți mai da o eroare banala.
Mai ales pe freakz când compilezi un plugin cu un DHUD.

Dacă primești erori cu extensia ".inc" nu ai acel inc in include la scripting.
De exemplu tu nu ai "colorchat.inc / dhudmessage.inc" descărcare exista pe net SI o poți pune in include SI nu îți mai da nicio eroare.
Salut.
>> XMAS.ARENADEVILS.RO # See you again in 2025 <<
>> DR.ARENADEVILS.RO # Official Deathrun Mod 2024 <<
User avatar
levin
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 3844
Joined: 24 Aug 2011, 12:24
Detinator Steam: Da
CS Status:
Detinator server CS: ☯∴
SteamID: riseofevo
Reputatie: Scripter eXtreamCS
Nume anterior: Adryyy
Location: ҳ̸Ҳ̸ҳ
Discord: devilclass
Has thanked: 36 times
Been thanked: 594 times
Contact:

05 Nov 2018, 19:40

eh | Afiseaza codul
#include <amxmodx>
#include <amxmisc>
#include <csx>
#include <csstats>
#include <nvault>

stock __dhud_color;
stock __dhud_x;
stock __dhud_y;
stock __dhud_effect;
stock __dhud_fxtime;
stock __dhud_holdtime;
stock __dhud_fadeintime;
stock __dhud_fadeouttime;
stock __dhud_reliable;

stock set_dhudmessage( red = 0, green = 160, blue = 0, Float:x = -1.0, Float:y = 0.65, effects = 2, Float:fxtime = 6.0, Float:holdtime = 3.0, Float:fadeintime = 0.1, Float:fadeouttime = 1.5, bool:reliable = false )
{
    #define clamp_byte(%1)       ( clamp( %1, 0, 255 ) )
    #define pack_color(%1,%2,%3) ( %3 + ( %2 << 8 ) + ( %1 << 16 ) )

    __dhud_color       = pack_color( clamp_byte( red ), clamp_byte( green ), clamp_byte( blue ) );
    __dhud_x           = _:x;
    __dhud_y           = _:y;
    __dhud_effect      = effects;
    __dhud_fxtime      = _:fxtime;
    __dhud_holdtime    = _:holdtime;
    __dhud_fadeintime  = _:fadeintime;
    __dhud_fadeouttime = _:fadeouttime;
    __dhud_reliable    = _:reliable;

    return 1;
}

stock show_dhudmessage( index, const message[], any:... )
{
    new buffer[ 128 ];
    new numArguments = numargs();

    if( numArguments == 2 )
    {
        send_dhudMessage( index, message );
    }
    else if( index || numArguments == 3 )
    {
        vformat( buffer, charsmax( buffer ), message, 3 );
        send_dhudMessage( index, buffer );
    }
    else
    {
        new playersList[ 32 ], numPlayers;
        get_players( playersList, numPlayers, "ch" );

        if( !numPlayers )
        {
            return 0;
        }

        new Array:handleArrayML = ArrayCreate();

        for( new i = 2, j; i < numArguments; i++ )
        {
            if( getarg( i ) == LANG_PLAYER )
            {
                while( ( buffer[ j ] = getarg( i + 1, j++ ) ) ) {}
                j = 0;

                if( GetLangTransKey( buffer ) != TransKey_Bad )
                {
                    ArrayPushCell( handleArrayML, i++ );
                }
            }
        }

        new size = ArraySize( handleArrayML );

        if( !size )
        {
            vformat( buffer, charsmax( buffer ), message, 3 );
            send_dhudMessage( index, buffer );
        }
        else
        {
            for( new i = 0, j; i < numPlayers; i++ )
            {
                index = playersList[ i ];

                for( j = 0; j < size; j++ )
                {
                    setarg( ArrayGetCell( handleArrayML, j ), 0, index );
                }

                vformat( buffer, charsmax( buffer ), message, 3 );
                send_dhudMessage( index, buffer );
            }
        }

        ArrayDestroy( handleArrayML );
    }

    return 1;
}

stock send_dhudMessage( const index, const message[] )
{
    message_begin( __dhud_reliable ? ( index ? MSG_ONE : MSG_ALL ) : ( index ? MSG_ONE_UNRELIABLE : MSG_BROADCAST ), SVC_DIRECTOR, _, index );
    {
        write_byte( strlen( message ) + 31 );
        write_byte( DRC_CMD_MESSAGE );
        write_byte( __dhud_effect );
        write_long( __dhud_color );
        write_long( __dhud_x );
        write_long( __dhud_y );
        write_long( __dhud_fadeintime );
        write_long( __dhud_fadeouttime );
        write_long( __dhud_holdtime );
        write_long( __dhud_fxtime );
        write_string( message );
    }
    message_end();
}

new gTime[33]
new gVault
new hostname[64]


public plugin_init() {
   gVault = nvault_open("TIME")
}

public client_authorized(id)
{
   loaddata(id)
}

public client_disconnect(id)
{
   gTime[id] += get_user_time(id)
   savedata(id)
}

public client_putinserver(id)
{
   if(is_user_bot(id)) return
   
   set_task(10.0, "welcomeHUD", id)
   set_task(10.0, "hostHUD", id)
   set_task(5.0, "adminHUD", id)
}

public welcomeHUD(id)
{
   new stats[8], body[8], nick[32], hostname[64]
   
   new rank_pos = get_user_stats(id, stats, body)
   new rank_max = get_statsnum()
   get_user_name(id, nick, 31)
   get_cvar_string("hostname",hostname,63)
   new iTimeMins = gTime[id] / 60
   
   static Deaths = 0, Kills = 0, Float:Ratio = 0.0
   
   Deaths = stats[1], Kills = stats[0], Ratio = Deaths == 0 ? (float(Kills)) : (float(Kills) / float(Deaths))
   
   set_dhudmessage(0, 255, 0, 0.03, 0.30, 2, 6.0, 8.0 )
   show_dhudmessage(id, "Welcome, %s^nRank: %d of %d^nKills: %d Deaths: %d KPD: %.2f^nOnline: %i m^nEnjoY!", nick,rank_pos,rank_max,stats[0], stats[1], Ratio,iTimeMins)
}

stock savedata(id)
{
   new AuthId[65]
   get_user_authid(id, AuthId, charsmax(AuthId))
   
   new VaultKey[64], VaultData[256]
   format(VaultKey, 63, "%s-TIME", AuthId)
   format(VaultData, 254, "%i", gTime[id])
   
   nvault_set(gVault, VaultKey, VaultData)
   
   return PLUGIN_CONTINUE
}

stock loaddata(id)
{
   new AuthID[35] 
   get_user_authid(id,AuthID,charsmax(AuthID ))
   new vaultkey[64],vaultdata[256]
   
   format(vaultkey,63,"%s-TIME" ,AuthID) 
   format(vaultdata,255,"%i",gTime[id]) 
   
   nvault_get(gVault,vaultkey,vaultdata,charsmax (vaultdata))
   
   new Time[33]
   parse(vaultdata, Time, charsmax(Time))
   
   gTime[id] = str_to_num(Time)
}

public hostHUD(id)
{
          get_cvar_string("hostname", hostname, 63)

   set_dhudmessage(212, 42, 255, 0.03, 0.5, 2, 6.0, 10.0)
   show_dhudmessage(id, "%s^nDon't forget to add IP to your favourites!", hostname)
}

public adminHUD(id)
{
   if (is_user_admin(id))
   {
      set_dhudmessage(0, 255, 255, 0.03, 0.75, 2, 6.0, 3.0);
      show_dhudmessage(id, "You are now Administrator!");
   }
}
Pentru ajutor, faceți cerere bine detaliată, completând și respectând modelul corespunzător.
Nu-mi mai dați cereri doar pentru a mă avea în lista de prieteni.
Dacă te ajut, și mă ignori/etc > te adaug în „foe”.
Aveți grijă la cei ce încearcă să mă copieze sau să dea drept mine..Puteți lua legătura cu mine prin STEAM dacă aveți o problemă/nelămurire în acest caz! Cont de forum am doar aici.
În cazul în care utilizați ceva din ce am postat(ex: aici), e bine să fiți la curent cu modificările aduse și de aici, iar dacă sunt ceva probleme nu ezitați să luați legătura cu mine. Actualizarea unor coduri nu se vor afișa public, doar dacă se găsește ceva critic/urgent de remediat, unele fiind coduri vechi iar unele refăcute chiar recent dar private.
* Nume pe cs1.6: eVoLuTiOn \ Nume vechi: eVo
* Atelierul meu - post2819572.html#p2819572 (închis, click link ca să vedeți de ce)
User avatar
FizZle
Membru, skill +4
Membru, skill +4
Posts: 1622
Joined: 17 Jan 2015, 19:33
Detinator Steam: Da
Detinator server CS: da
SteamID: berserknorse
Fond eXtream: 0
Location: Iasi
Has thanked: 21 times
Been thanked: 26 times
Contact:

05 Nov 2018, 20:04

asta merge , mersi mult .
Post Reply

Return to “Cereri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 27 guests