Modifica comanda ta de ban cu asta : if(strcmp(cmd, "/ban", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /ban [playerid/PartOfName] [reason]");
return 1;
}
new playa;
playa = ReturnUser(tmp);
giveplayerid = ReturnUser(tmp);
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if(PlayerInfo[playa][pAdmin] >= 4)
{
SendClientMessage(playerid, COLOR_LIGHTRED, "Acest Player Nu Poate Fi Banat.");
format(string, 256, "AdmWarning: %s incearca comanda /ban pe %s , dar nu reuseste pentru ca are admin cu imunitate.", sendername, giveplayer);
ABroadCast(COLOR_YELLOW,string,1);
return 1;
}
giveplayerid = ReturnUser(tmp);
if (PlayerInfo[playerid][pAdmin] >= 1338)
{
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] [reason]");
return 1;
}
new year, month,day;
getdate(year, month, day);
format(string, sizeof(string), "AdmCmd: %s a luat ban de la %s, Motiv: %s (%d-%d-%d)", giveplayer, sendername, (result),month,day,year);
BanLog(string);
format(string, sizeof(string), "AdmCmd: %s a luat ban de la %s, Motiv: %s", giveplayer, sendername, (result));
SendClientMessageToAll(COLOR_LIGHTRED, string);
new plrIP[16];
GetPlayerIp(giveplayerid,plrIP, sizeof(plrIP));
SendClientMessage(giveplayerid,COLOR_DBLUE,"|___________[BAN INFO]___________|");
format(string, sizeof(string), "Numele tau este: %s.",giveplayer);
SendClientMessage(giveplayerid, COLOR_WHITE, string);
format(string, sizeof(string), "IP-ul tau este: %s.",plrIP);
SendClientMessage(giveplayerid, COLOR_WHITE, string);
format(string, sizeof(string), "Ai fost banat de: %s.",sendername);
SendClientMessage(giveplayerid, COLOR_WHITE, 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 (Ziua-Luna-Anul)",day,month,year);
SendClientMessage(giveplayerid, COLOR_WHITE, string);
SendClientMessage(giveplayerid,COLOR_DBLUE,"|___________[BAN INFO]___________|");
SendClientMessage(giveplayerid,COLOR_LIGHTRED,"[BAN INFO]: Poti face o cerere de unban pe forumul nostru.Forumul este www.sa-mp.ro !");
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 !");
Ban(giveplayerid);
return 1;
}
}//not connected
}
else
{
format(string, sizeof(string), " Acest player nu este online %d. Sau nu ai acces la comanda! BAFTA!", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
return 1;
}