Dzisiaj pierwszy raz plugin ad_menager zaczął wywałac errory w logach prze 4 dni od jego wrzucenia nic, wszystko ładnie działał
Był by ktoś w stanie wyeliminowac ten error?
Będę bardzo wdzieczny. Za wszystkie odpowiedzi wynagradzam +
I szcze jedno pytanko, dlaczego po wrzuceniu pluginu na serwer zadnych errorów nie wywalało tylko dopiero po 4 dniach?
Pozdrawiam
Logi:
L 08/13/2011 - 14:00:30: Info (map "de_rats_1337") (file "addons/amxmodx/logs/error_20110813.log") L 08/13/2011 - 14:00:30: replace() buffer not big enough (109>=108) L 08/13/2011 - 14:00:30: [AMXX] Displaying debug trace (plugin "ad_manager.amxx") L 08/13/2011 - 14:00:30: [AMXX] Run time error 10: native error (native "replace") L 08/13/2011 - 14:00:30: [AMXX] [0] string.inc::replace_all (line 239) L 08/13/2011 - 14:00:30: [AMXX] [1] ad_manager_57934.sma::displayAd (line 285) L 08/13/2011 - 14:00:30: [AMXX] [2] ad_manager_57934.sma::eventTask (line 205)
Linijka (239)
data[0] = a;
kawałek kodu
public eventSay(id)
{
//If nothing is said, don't check
if(adCount[SAY_AD] == 0)
return PLUGIN_CONTINUE;
new talk[64], keyword[16];
read_args(talk, 63) ;
//En nu rennen voor jullie zakgeld klootzjakken!
for(new a = 0; a < adCount[SAY_AD]; a++)
{
//Get the string
getString(STORE, SAY_AD, keyword, 15, a, 0);
if(containi(talk, keyword) != -1)
{
//Check the rest if it fails to conditions
if(!checkConditions(a, SAY_AD))
continue;
new data[3];
data[0] = a;
data[1] = SAY_AD;
data[2] = id;
//Set the task
set_task(0.3, "displayAd", 0, data, 3);
//Don't execute more of them
break;
}
}
return PLUGIN_CONTINUE;
}Linijka (285)
replace_all(temp,charsmax(temp),"[you]",name)
kawałek kodu
public displayAd(params[])
{
//Get the string that is going to be displayed
new message[128];
getString(STORE, params[1], message, 127, params[0], params[1]);
//If its enabled by cvar and id is set, display to person who triggered message only
if(get_cvar_num("ad_react_all") == 0 && params[2] != 0)
{
new name[64];
get_user_name(params[2],name,charsmax(name));
replace_all(message,charsmax(message),"[you]",name)
message_begin(MSG_ONE, gmsgSayText, {0,0,0}, params[2]);
write_byte(params[2]);
write_string(message);
message_end();
} else
{
//Display the message to everyone
new plist[32], playernum, player;
get_players(plist, playernum, "c");
for(new i = 0; i < playernum; i++)
{
player = plist[i];
new temp[128];
copy(temp,charsmax(temp),message);
new name[64];
get_user_name(player,name,charsmax(name));
replace_all(temp,charsmax(temp),"[you]",name)
message_begin(MSG_ONE, gmsgSayText, {0,0,0}, player);
write_byte(player);
write_string(temp);
message_end();
}
}
return PLUGIN_HANDLED;
}
Linijka (205)
displayAd(data);
kawałek kodu
public eventTask()
{
//Go past all ads and check conditions
for(new a = 0; a < adCount[NORM_AD]; a++)
{
//Put current ad to the next one
currAd = currAd == adCount[NORM_AD] - 1 ? 0 : currAd + 1;
if(checkConditions(currAd, NORM_AD))
{
//Display the ad
new data[3];
data[0] = currAd;
data[1] = NORM_AD;
data[2] = 0;
displayAd(data);
break;
}
}
//Set a new task
set_task(random_float(RAND_MIN, RAND_MAX), "eventTask");
return PLUGIN_CONTINUE;
}
Sma w załaczniku.


Dodatki SourceMod



Temat jest zamknięty
ad_manager.amxx









