maDskiLL
Admin

Data inscrierii: 01/Apr/2007 Mesaje: 33
|
|
Plugin : Connect & Disconnect Announce [AMXX] |
|
Pluginul il luati de aici-->http://forums.alliedmods.net/showthread.php?p=163726, modificat de mine, adaugat IP, si sunet... Sunt, de fapt, 2 pluginuri, unul pentru connect, altul pentru disconnect, fiinda amandoua au sunete diferite...
Am modificat cvar-ul din al 2-lea plugin, pentru ca daca il lasam normal, apareau 2 mesaje cand cineva se conecta. Pluginul este tradus in romana, pentru mai numeroase detalii, uita-te mai jos:
-=-=-=-=- ULTIMATE CONNECT -=-=-=-=-
Code:
#include <amxmodx>
#define PLUGIN "Connect Announce"
#define VERSION "0.3b"
#define AUTHOR "v3x"
new g_iMsgSayText, g_szSoundFile[] = "misc/access.wav";
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR);
register_cvar("announce_mode","1");
register_cvar("announce_sound","1");
g_iMsgSayText = get_user_msgid("SayText");
}
/*
announce_mode <0>
0 - Off
1 - Connect announce only
2 - Disconnect announce only
3 - Both
announce_sound <0>
0 - No sound
1 - Sound
*/
public plugin_precache()
{
precache_sound(g_szSoundFile);
}
public client_authorized(id)
{
new iMode = get_cvar_num("announce_mode");
if(is_user_bot(id) || iMode == 0 || iMode == 2)
return PLUGIN_CONTINUE;
new szUserName[33];
get_user_name(id,szUserName,32);
new g_szIP[33][44];
get_user_ip(id , g_szIP[id] , 43);
new iPlayers[32], iNum, i;
get_players(iPlayers,iNum);
for(i = 0; i <= iNum; i++)
{
new x = iPlayers[i];
if(!is_user_connected(x) || is_user_bot(x)) continue;
if(get_cvar_num("announce_sound") == 1)
client_cmd(x, "spk %s", g_szSoundFile);
new szMessage[164];
format(szMessage, 163, "^x04* Atentie ! ^x03%s ^x01s-a conectat. ^x04IP: ^x03%s !", szUserName , g_szIP[id]);
message_begin( MSG_ONE, g_iMsgSayText, {0,0,0}, x );
write_byte ( 3 );
write_string( szMessage );
message_end ();
}
return PLUGIN_CONTINUE;
}
-=-=-=-=- ULTIMATE DISCONNECT -=-=-=-=-
Code:
#include <amxmodx>
#define PLUGIN "Connect Announce"
#define VERSION "0.3b"
#define AUTHOR "v3x"
new g_iMsgSayText, g_szSoundFile[] = "misc/beback.wav";
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR);
register_cvar("announce_module","2");
register_cvar("announce_sound","1");
g_iMsgSayText = get_user_msgid("SayText");
}
/*
announce_module <0>
0 - Off
1 - Connect announce only
2 - Disconnect announce only
3 - Both
announce_sound <0>
0 - No sound
1 - Sound
*/
public plugin_precache()
{
precache_sound(g_szSoundFile);
}
public client_disconnect(id)
{
new iMode = get_cvar_num("announce_module");
if(is_user_bot(id) || iMode == 0 || iMode == 1)
return PLUGIN_CONTINUE;
new szUserName[33];
get_user_name(id, szUserName, 32);
new szAuthID[33];
get_user_authid(id , szAuthID , 32);
new iPlayers[32], iNum, i;
get_players(iPlayers, iNum);
for(i = 0; i <= iNum; i++)
{
new x = iPlayers[i];
if(!is_user_connected(x) || is_user_bot(x)) continue;
if(get_cvar_num("announce_sound") == 1)
client_cmd(x, "spk %s", g_szSoundFile);
new szMessage[164];
format(szMessage, 163, "^x04* %s ^x01s-a deconectat !", szUserName);
message_begin( MSG_ONE, g_iMsgSayText, {0,0,0}, x );
write_byte ( 3 );
write_string( szMessage );
message_end ();
}
return PLUGIN_CONTINUE;
}
* Copiati textul dorit intr-un editor de text, apoi salvati-l cu extensia .SMA, apoi compilati.
* Eu personal l-am testat, si merge .
* Pentru alte probleme, postati aici .
* Sper sa va fie de folos si aprobat .
|
|