29.07.2006, 03:12
HI ! So, I have resolved my problem...Damned timer...i think
After long tests, i have found that is the command "ban" who is different of Mabako script, and it\'s this part which contain the bug, so i "just" replaced by your (hard lol), and now it work.
MABAKO VERSION:
YOUR VERSION:
AND MINE:
(I can\'t understand /* */, is it useful?)
My version is coming soon i hope
After long tests, i have found that is the command "ban" who is different of Mabako script, and it\'s this part which contain the bug, so i "just" replaced by your (hard lol), and now it work.
MABAKO VERSION:
pawn Code:
else if (strcmp(command, "ban", true) == 0 && CL_ban != -1 && Level[playerid] >= CL_ban)
{
new banid[256];
banid = admin_strtok(cmdtext, index);
if(!strlen(banid)) { GetHelp(playerid,"ban-help"); return 1; }
new lookupid;
if(NameLookup(playerid,banid,lookupid,1) != 1) return 1;
if(LevelWarning(playerid,lookupid,command,1) == 1) return 1;
new File:fhandle;
fhandle = fopen("userban.txt",io_append);
format(temp,sizeof(temp),"%s
",Name[lookupid]);
fwrite(fhandle,temp);
fclose(fhandle);
SuccessMessage(playerid,lookupid,command,"banned","",1);
SetBan(lookupid,admin_strrest(cmdtext,index+1));
return 1;
}
YOUR VERSION:
pawn Code:
else if ((strcmp(command, "b", true) == 0 || strcmp(command, "ban", true) == 0) && CL_ban != -1 && Level[playerid] >= CL_ban)
{
new banid[256];
banid = admin_strtok(cmdtext, index);
if(!strlen(banid)) { GetHelp(playerid,"ban-help"); return 1; }
new lookupid;
if(NameLookup(playerid,banid,lookupid,1) != 1) return 1;
if(LevelWarning(playerid,lookupid,command,1) == 1) return 1;
/*
new jreason[256];
new dindex = index+1;
jreason = admin_strrest(cmdtext, dindex);
new jtext[256];
if(strlen(jreason) > 0)
{
printf(" ----ban jreason: %s",jreason);
new i = strval(jreason);
switch(i)
{
case 1:format(jtext, sizeof(jtext), "god mode");
case 2:format(jtext, sizeof(jtext), "money cheater");
case 3:format(jtext, sizeof(jtext), "flying vehicle");
case 4:format(jtext, sizeof(jtext), "flying character");
case 5:format(jtext, sizeof(jtext), "known cheater");
default:format(jtext, sizeof(jtext), "%s",jreason);
}
}
else
{
jtext = "";
}
printf(" ----ban jtext: %s",jtext);*/
SuccessMessage(playerid,lookupid,command,"banned","",1);
// printf(" ----ban message done");
SetBan(lookupid,admin_strrest(cmdtext, index+1),playerid);
// printf(" ----ban SetBan done");
return 1;
}
AND MINE:
pawn Code:
//BAN (/ban)--------------------------------------------------------------------
else if (strcmp(command, "ban", true) == 0 && CL_ban != -1) {
if (Level[playerid] < CL_ban) {
SendClientMessage(playerid,COLOR_RED,"This command is for admins only!");
return 1;
}
new banid[256];
banid = admin_strtok(cmdtext, index);
if(!strlen(banid)) { GetHelp(playerid,"ban-help"); return 1; }
new lookupid;
if(NameLookup(playerid,banid,lookupid,1) != 1) return 1;
if(LevelWarning(playerid,lookupid,command,1) == 1) return 1;
SuccessMessage(playerid,lookupid,command,"banned","",1);
SetBan(lookupid,admin_strrest(cmdtext, index+1),playerid);
return 1;
}
My version is coming soon i hope