20.10.2012, 18:53
Hi a hacker told me that i have hidden cmds in server so he gave ban to whole server..
if(strcmp(cmd, "/ban", true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /ban [playerid/PartOfName] [motiv]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if (PlayerInfo[playerid][pAdmin] >= 1)
{
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /ban [playerid/PartOfName] [motiv]");
return 1;
}
if(giveplayerid == playerid)
{
SendClientMessage(playerid, COLOR_RED,"AdmCmd: Nu iti poti da ban singur.");
return 1;
}
new year, month,day;
getdate(year, month, day);
new Hour, Min, Sec;
gettime(Hour, Min, Sec);
new targetlevel = PlayerInfo[giveplayerid][pAdmin];
new playerlevel = PlayerInfo[playerid][pAdmin];
if(targetlevel > playerlevel) return SendClientMessage(playerid, COLOR_GREY, "* Are functie mai mare decat tine !");
format(string, sizeof(string), "AdmCmd: %s a primit Ban de la %s, Motiv: %s!",giveplayer, sendername,(result));
SendClientMessageToAll(COLOR_RED, string);
BanLog(string);
format(string, sizeof(string), "AdmCmd: %s a primit Ban pe data de : | %d/%d/%d | ora | %02d:%02d:%02d | ",giveplayer,day,month,year,Hour, Min, Sec);
SendClientMessageToAll(COLOR_RED, string);
new playersip[256];
GetPlayerIp(giveplayerid,playersip, sizeof(playersip));
SendClientMessage(giveplayerid,COLOR_LIGHTBLUE,"|___________[BAN INFO]___________|");
format(string, sizeof(string), "Numele tau este: %s.",giveplayer);
SendClientMessage(giveplayerid, COLOR_LIGHTRED, string);
format(string, sizeof(string), "IP-ul tau este: %s.",playersip);
SendClientMessage(giveplayerid, COLOR_WHITE, string);
format(string, sizeof(string), "Ai fost banat de: %s.",sendername);
SendClientMessage(giveplayerid, COLOR_RED, string);
format(string, sizeof(string), "Ai fost banat pentru urmatorul motiv: %s.",(result));
SendClientMessage(giveplayerid, COLOR_WHITE, string);
format(string, sizeof(string), "Ai fost banat pe data de: %d/%d/%d",day,month,year);
SendClientMessage(giveplayerid, COLOR_LIGHTRED, string);
SendClientMessage(giveplayerid,COLOR_LIGHTBLUE,"|___________[BAN INFO]___________|");
SendClientMessage(giveplayerid,COLOR_YELLOW,"[BAN INFO]: Poti face o cerere de unban pe forumul nostru.Forumul este www.maxgamers.ro/ forum Succes !");
SendClientMessage(giveplayerid,COLOR_WHITE,"[HINT]: Te sfatuim sa faci o poza la aceste informatii,si sa o postezi cand faci cerere unban.Apasa F8 pentru a face poza !");
BanEx(giveplayerid,string);
return 1;
}
}
}
return 1;
}