#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <csx>
#define TEXT_LEN 127
#define MAX_LINES 5
new gmsgidSayText;
new gszHost[32];
new bool:gbFirst[33];
new gszMessage[MAX_LINES][TEXT_LEN];
new giPointer=0;
public plugin_init(){
register_plugin("Welcome message", "1.1", "R3X");
RegisterHam(Ham_Spawn, "player", "player_spawn", 1);
new szFile[128], szLine[TEXT_LEN+1], iLen;
get_configsdir(szFile, 95);
add(szFile, 127,"/welcome.txt");
if(!file_exists(szFile))
return set_fail_state("Nie ma pliku welcome.txt");
for(new i=0;read_file(szFile, i, szLine, TEXT_LEN, iLen);i++){
if(iLen==0) continue;
if(giPointer>=MAX_LINES) break;
copy(gszMessage[giPointer++], TEXT_LEN, szLine);
}
get_user_name(0, gszHost, 31);
gmsgidSayText = get_user_msgid("SayText");
return PLUGIN_CONTINUE;
}
public client_putinserver(id)
gbFirst[id] = true;
public player_spawn(id){
if(gbFirst[id]){
static szMessage[TEXT_LEN+1];
szMessage[0]='^x01';
for(new i=0;i<giPointer;i++){
copy(szMessage[1], TEXT_LEN, gszMessage[i]);
formatMessage(id, szMessage);
print(id, szMessage);
}
gbFirst[id] = false;
}
return HAM_IGNORED;
}
formatMessage(id, szMessage[]){
static szBuff[32];
get_user_name(id, szBuff, 31);
replace_all(szMessage, 95, "[you]", szBuff);
static one[8], two[8];
new poz = get_user_stats(id, one, two);
formatex(szBuff, 31, "%d", poz);
replace_all(szMessage, 95, "[rank]", szBuff);
formatex(szBuff, 31, "%d", get_statsnum());
replace_all(szMessage, 95, "[rank_max]", szBuff);
replace_all(szMessage, 95, "[host]", gszHost);
replace_all(szMessage, 95, "!t", "^x03");
replace_all(szMessage, 95, "!n", "^x01");
replace_all(szMessage, 95, "!g", "^x04");
}
print(id, const szMessage[]){
message_begin(MSG_ONE,gmsgidSayText , _, id);
write_byte(id);
write_string(szMessage);
message_end();
}
W logach mi buguje ten plugin
L 10/10/2009 - 10:53:38: replace() buffer not big enough (90>=86) L 10/10/2009 - 10:53:38: [AMXX] Run time error 10 (plugin "welcome.amxx") (native "replace") - debug not enabled! L 10/10/2009 - 10:53:38: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes). L 10/10/2009 - 10:54:09: replace() buffer not big enough (87>=86) L 10/10/2009 - 10:54:09: [AMXX] Run time error 10 (plugin "welcome.amxx") (native "replace") - debug not enabled! L 10/10/2009 - 10:54:09: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes). L 10/10/2009 - 10:54:09: replace() buffer not big enough (87>=86) L 10/10/2009 - 10:54:09: [AMXX] Run time error 10 (plugin "welcome.amxx") (native "replace") - debug not enabled! L 10/10/2009 - 10:54:09: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes). L 10/10/2009 - 10:54:09: replace() buffer not big enough (90>=86) L 10/10/2009 - 10:54:09: [AMXX] Run time error 10 (plugin "welcome.amxx") (native "replace") - debug not enabled! L 10/10/2009 - 10:54:09: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes). L 10/10/2009 - 10:54:09: replace() buffer not big enough (98>=86) L 10/10/2009 - 10:54:09: [AMXX] Run time error 10 (plugin "welcome.amxx") (native "replace") - debug not enabled! L 10/10/2009 - 10:54:09: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes). L 10/10/2009 - 10:54:09: replace() buffer not big enough (94>=86) L 10/10/2009 - 10:54:09: [AMXX] Run time error 10 (plugin "welcome.amxx") (native "replace") - debug not enabled! L 10/10/2009 - 10:54:09: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes). L 10/10/2009 - 10:54:09: replace() buffer not big enough (94>=86) L 10/10/2009 - 10:54:09: [AMXX] Run time error 10 (plugin "welcome.amxx") (native "replace") - debug not enabled! L 10/10/2009 - 10:54:09: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes). L 10/10/2009 - 10:56:01: replace() buffer not big enough (87>=86) L 10/10/2009 - 10:56:01: [AMXX] Run time error 10 (plugin "welcome.amxx") (native "replace") - debug not enabled! L 10/10/2009 - 10:56:01: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes). L 10/10/2009 - 10:56:01: replace() buffer not big enough (87>=86) L 10/10/2009 - 10:56:01: [AMXX] Run time error 10 (plugin "welcome.amxx") (native "replace") - debug not enabled! L 10/10/2009 - 10:56:01: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes). L 10/10/2009 - 10:56:01: replace() buffer not big enough (90>=86) L 10/10/2009 - 10:56:01: [AMXX] Run time error 10 (plugin "welcome.amxx") (native "replace") - debug not enabled! L 10/10/2009 - 10:56:01: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes). L 10/10/2009 - 10:56:01: replace() buffer not big enough (98>=86) L 10/10/2009 - 10:56:01: [AMXX] Run time error 10 (plugin "welcome.amxx") (native "replace") - debug not enabled! L 10/10/2009 - 10:56:01: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes). L 10/10/2009 - 10:56:01: replace() buffer not big enough (94>=86) L 10/10/2009 - 10:56:01: [AMXX] Run time error 10 (plugin "welcome.amxx") (native "replace") - debug not enabled! L 10/10/2009 - 10:56:01: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes). L 10/10/2009 - 10:56:01: replace() buffer not big enough (94>=86) L 10/10/2009 - 10:56:01: [AMXX] Run time error 10 (plugin "welcome.amxx") (native "replace") - debug not enabled! L 10/10/2009 - 10:56:01: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes). L 10/10/2009 - 10:57:23: replace() buffer not big enough (87>=86) L 10/10/2009 - 10:57:23: [AMXX] Run time error 10 (plugin "welcome.amxx") (native "replace") - debug not enabled! L 10/10/2009 - 10:57:23: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes). L 10/10/2009 - 10:57:23: replace() buffer not big enough (87>=86) L 10/10/2009 - 10:57:23: [AMXX] Run time error 10 (plugin "welcome.amxx") (native "replace") - debug not enabled! L 10/10/2009 - 10:57:23: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes). L 10/10/2009 - 10:57:23: replace() buffer not big enough (90>=86) L 10/10/2009 - 10:57:23: [AMXX] Run time error 10 (plugin "welcome.amxx") (native "replace") - debug not enabled! L 10/10/2009 - 10:57:23: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes). L 10/10/2009 - 10:57:23: replace() buffer not big enough (98>=86) L 10/10/2009 - 10:57:23: [AMXX] Run time error 10 (plugin "welcome.amxx") (native "replace") - debug not enabled! L 10/10/2009 - 10:57:23: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes). L 10/10/2009 - 10:57:23: replace() buffer not big enough (94>=86) L 10/10/2009 - 10:57:23: [AMXX] Run time error 10 (plugin "welcome.amxx") (native "replace") - debug not enabled! L 10/10/2009 - 10:57:23: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes). L 10/10/2009 - 10:57:23: replace() buffer not big enough (94>=86) L 10/10/2009 - 10:57:23: [AMXX] Run time error 10 (plugin "welcome.amxx") (native "replace") - debug not enabled! L 10/10/2009 - 10:57:23: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes). L 10/10/2009 - 10:58:29: replace() buffer not big enough (87>=86) L 10/10/2009 - 10:58:29: [AMXX] Run time error 10 (plugin "welcome.amxx") (native


Dodatki SourceMod



Temat jest zamknięty










