26.05.2010, 19:45
tenta mas eu nem testei
pawn Код:
if(strcmp(cmd, "/ban", true) == 0)
{
new tmp2[256];
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
tmp2 = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /ban [ID] [razгo]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if (PlayerInfo[playerid][pAdmin] >= 3)
{
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
new year, month,day;
getdate(year, month, day);
format(string, sizeof(string), "AdmCmd: %s foi banido por %s, Razгo: %s (%d-%d-%d)", giveplayer, sendername, tmp2,month,day,year);
BanLog(string);
format(string, sizeof(string), "AdmCmd: %s foi banido por %s, Razгo: %s", giveplayer, sendername, tmp2);
SendClientMessageToAll(COLOR_LIGHTRED, string);
PlayerInfo[giveplayerid][pLocked] = 1;
Ban(giveplayerid);
return 1;
}
}//not connected
else
{
format(string, sizeof(string), " %d nгo й um player ativo.", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
}
return 1;
}