Plugin kodlama
Moderatör: Moderatörler
Forum kuralları
[font size=20] DİKKAT [/font]
Silinmiş konu içerikleri hiçbir şekilde kontrol edlimemektedir. İndirdiğiniz dosyaların sorumluluğu tamamiyle size aittir.
Mutlaka indirdiğiniz dosyaları antivirüs ile taratınız.
[font size=20] DİKKAT [/font]
Silinmiş konu içerikleri hiçbir şekilde kontrol edlimemektedir. İndirdiğiniz dosyaların sorumluluğu tamamiyle size aittir.
Mutlaka indirdiğiniz dosyaları antivirüs ile taratınız.
-
Konu Sahibi - Mesajlar: 580
- Kayıt: Çrş Haz 07, 2017 11:50 am
- Konum: Kayseri
- Server Ip/DNS: 213.238.173.28
- Clan İsmi: Quanaril ' Jail
- İletişim:
Plugin kodlama
Merhaba arkadaşlar biraz biraz plugin kodlamaya çabalıyorum fakat bir sorum olacak.
Şuan da bir menü yaptım basınca hiçbir şey olmuyor. server_cmd falan yazdırmak istiyorum
menu_additem 'deki "1" mesela burası 1 ise;
case 1 yazıp server_cmd kodunu eklesek olur mu?
Şuan da bir menü yaptım basınca hiçbir şey olmuyor. server_cmd falan yazdırmak istiyorum
menu_additem 'deki "1" mesela burası 1 ise;
case 1 yazıp server_cmd kodunu eklesek olur mu?
Link: | |
Linklerini gizle |
-
- Mesajlar: 68
- Kayıt: Cum Ağu 12, 2016 10:02 am
Plugin kodlama
menu parametleri vs. herşeyi doğru yapıldıysa ( yapamıyorsanız başlardaysanız menu oluşturucu programlar mevcut) hiç bir problem yaşanmayacaktır additem ile uyuşacak şekilde case kısmına istediğiniz komutu index parametresine uygun doldurdugunuz sürece menunuz çalışacaktır .mkiranatli yazdı:Merhaba arkadaşlar biraz biraz plugin kodlamaya çabalıyorum fakat bir sorum olacak.
Şuan da bir menü yaptım basınca hiçbir şey olmuyor. server_cmd falan yazdırmak istiyorum
menu_additem 'deki "1" mesela burası 1 ise;
case 1 yazıp server_cmd kodunu eklesek olur mu?
servere cmd göndermek servere yük veren işlemlerdendir bu sebepten çok fazla server cmd komutu eklentiler içerisine yerleştirmeniz tavsiye edilmemektedir
Link: | |
Linklerini gizle |
-
Konu Sahibi - Mesajlar: 580
- Kayıt: Çrş Haz 07, 2017 11:50 am
- Konum: Kayseri
- Server Ip/DNS: 213.238.173.28
- Clan İsmi: Quanaril ' Jail
- İletişim:
Plugin kodlama
Hocam dediğiniz şekilde yapıyorum chatcolor ekledim ve stock kodunu ekledim fakat şu şekilde hata aldım;tarkan yazdı:menu parametleri vs. herşeyi doğru yapıldıysa ( yapamıyorsanız başlardaysanız menu oluşturucu programlar mevcut) hiç bir problem yaşanmayacaktır additem ile uyuşacak şekilde case kısmına istediğiniz komutu index parametresine uygun doldurdugunuz sürece menunuz çalışacaktır .mkiranatli yazdı:Merhaba arkadaşlar biraz biraz plugin kodlamaya çabalıyorum fakat bir sorum olacak.
Şuan da bir menü yaptım basınca hiçbir şey olmuyor. server_cmd falan yazdırmak istiyorum
menu_additem 'deki "1" mesela burası 1 ise;
case 1 yazıp server_cmd kodunu eklesek olur mu?
servere cmd göndermek servere yük veren işlemlerdendir bu sebepten çok fazla server cmd komutu eklentiler içerisine yerleştirmeniz tavsiye edilmemektedir
deneme.sma(26) : error 017: undefined symbol "ChatColor"
deneme.sma(26) : warning 215: expression has no effect
deneme.sma(26) : error 017: undefined symbol "REK"
deneme.sma(26) : error 029: invalid expression, assumed zero
deneme.sma(26) : fatal error 107: too many error messages on one line
26. kodda da şu yazıyor hocam;
ChatColor(id,GREEN,"Yetkiniz Yok.",REK)
Link: | |
Linklerini gizle |
-
- Mesajlar: 1667
- Kayıt: Çrş Nis 26, 2017 12:19 am
- Konum: Bilinmiyor.
Plugin kodlama
define den sonra 1 boşluk bırakıp yapıştırın bunu;
Kod: Tümünü seç
#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 TeamName[][] =
{
"",
"TERRORIST",
"CT",
"SPECTATOR"
}
ColorChat(id, Color:type, const msg[], {Float,Sql,Result,_}:...)
{
if( !get_playersnum() ) return;
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;
index = id;
} else {
index = FindPlayer();
MSG_Type = MSG_ALL;
}
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 bool:saytext_used;
static get_user_msgid_saytext;
if(!saytext_used)
{
get_user_msgid_saytext = get_user_msgid("SayText");
saytext_used = true;
}
message_begin(type, get_user_msgid_saytext, _, id);
write_byte(id)
write_string(message);
message_end();
}
Team_Info(id, type, team[])
{
static bool:teaminfo_used;
static get_user_msgid_teaminfo;
if(!teaminfo_used)
{
get_user_msgid_teaminfo = get_user_msgid("TeamInfo");
teaminfo_used = true;
}
message_begin(type, get_user_msgid_teaminfo, _, 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;
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/
Link: | |
Linklerini gizle |
-
Konu Sahibi - Mesajlar: 580
- Kayıt: Çrş Haz 07, 2017 11:50 am
- Konum: Kayseri
- Server Ip/DNS: 213.238.173.28
- Clan İsmi: Quanaril ' Jail
- İletişim:
Plugin kodlama
ChatColor 'u çözdük teşekkürler 
Son hatamız;
deneme.sma(191) : error 001: expected token: "}", but found "-end of file-"

Son hatamız;
deneme.sma(191) : error 001: expected token: "}", but found "-end of file-"
Link: | |
Linklerini gizle |
-
- Mesajlar: 1667
- Kayıt: Çrş Nis 26, 2017 12:19 am
- Konum: Bilinmiyor.
Plugin kodlama
Parantezleri kontrol edin, doğru yerde açıp doğru yerde kapatmış olup olmadığınızı.
Link: | |
Linklerini gizle |
-
Konu Sahibi - Mesajlar: 580
- Kayıt: Çrş Haz 07, 2017 11:50 am
- Konum: Kayseri
- Server Ip/DNS: 213.238.173.28
- Clan İsmi: Quanaril ' Jail
- İletişim:
-
Konu Sahibi - Mesajlar: 580
- Kayıt: Çrş Haz 07, 2017 11:50 am
- Konum: Kayseri
- Server Ip/DNS: 213.238.173.28
- Clan İsmi: Quanaril ' Jail
- İletişim:
Plugin kodlama
Hocalarım şuan da son adımdayım server_cmd komutunu kullanmak istemiyorum tarkan hocamın dediği gibi yoğunluk yapabilir servere. amx_tsay komutunu server_cmd ile değil de başka türlü nasıl tanımlayabilirim plugine?
Link: | |
Linklerini gizle |
-
- Mesajlar: 1667
- Kayıt: Çrş Nis 26, 2017 12:19 am
- Konum: Bilinmiyor.
Plugin kodlama
tsay dhudmessage miydi hudmessage mi, bu dhudmessage;
Kod: Tümünü seç
#include <amxmodx>
#define ilkmesaj "Serverimize Hosgeldin"
#define PLUGIN "Hosgeldin Mesaj"
#define VERSION "1.0"
#define AUTHOR "author"
#if defined _dhudmessage_included
#endinput
#endif
#define _dhudmessage_included
#include <amxmodx>
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();
}
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
}
public client_putinserver() {
set_task(6.0,"hosgeldinmesaj")
}
public hosgeldinmesaj(id) {
new isim[33]
get_user_name(id,isim,32)
set_dhudmessage(0, 255, 0, -1.0, 0.4, 0, 6.0, 5.0)
show_dhudmessage(id, "Merhaba, %s ^n%s^n%s^n%s",isim,ilkmesaj)
}
Link: | |
Linklerini gizle |