Hercules Elf Bot - Oct 18, 2012 13:26
Originally posted by [b]Oxxy[/b]
Setd and getd converting INT variables to STRING variables.
Try this npc to understand what i mean:
[CODE]
prontera, 147, 174, 6 script Øýтõôðýт 700,{
if(select("ãôðûøть рõÿутðцøю", "Ãâ€Ã¾Ã±Ã°Ã²Ã¸Ñ‚ÑŒ рõÿутðцøю") == 2)
{
mes "Ã’Ñ‹ ÿþûучøûø рõÿутðцøю у óþрþôð Izlude";
CallFunc ("get_rep", "125", "Izlude");
CallFunc ("show_rep", "Izlude");
close;
}
mes "àõÿутðцøю уôðûõýð";
CallFunc ("clear_rep", "Izlude");
CallFunc ("show_rep", "Izlude");
close;
}
function script get_rep {
if(getarg(1) != "Izlude") { debugmes "[Reputation System] There's no city with that name or it isn't added in array."; end; }
//setd getarg(1)+"_rep", (getd(getarg(1)+"_rep") + getarg(0));
//lool = getd(getarg(1)+"_rep");
//lool = lool + getarg(0);
//setd getarg(1)+"_rep", getd(getarg(1)+"_rep") + getarg(0);
//setd "rep_"+getarg(1), getd("rep_"+getarg(1)) + getarg(0);
setd "rep_"+getarg(1), getd("rep_"+getarg(1)) ++;
return;
}
function script show_rep {
if(getarg(0) != "Izlude") { debugmes "[Reputation System] There's no city with that name or it isn't added in array."; end; }
//dispbottom "ã ÒðѠ"+getd(getarg(0)+"_rep")+" рõÿутðцøø у óþрþôð "+getarg(0)+".";
dispbottom "ã ÒðѠ"+getd("rep_"+getarg(0))+" рõÿутðцøø у óþрþôð "+getarg(0)+".";
return;
}
function script clear_rep {
if(getarg(0) != "Izlude") { debugmes "[Reputation System] There's no city with that name or it isn't added in array."; end; }
if(getd(getarg(0)+"_rep") == 0) { debugmes "[Reputation System] Player "+strcharinfo(0)+" already have 0 reputation with "+getarg(0)+" town. "; close; }
//setd getarg(0)+"_rep", 0;
setd "rep_"+getarg(0), 0;
return;
}
[/CODE]
Sorry for russian text. Use option 2 in NPC for get reputation with Izlude town and you will understand what i mean. You can try other variants of the setd i have made with comments. They will not work correctly too.
NPC isn't giving us 125 rep every time. It will give like this: if rep = 0, then rep = 125. If rep = 125, then rep = 125125...
Hercules Elf Bot - Oct 18, 2012 15:47
Originally posted by [b]AnnieRuru[/b]
change
CallFunc ("get_rep", "125", "Izlude");
into
CallFunc ("get_rep", 125, "Izlude");
125 + 125 = 250
"125" + "125" = "125125"
lol
Hercules Elf Bot - Oct 19, 2012 11:40
Originally posted by [b]Oxxy[/b]
Omg, that's a facepalm. I'm really sorry!