02.04.2016, 16:45
I really can't understand your scripting, also I don't script dini
but
try this
but
pawn Код:
COMMAND:suspend(playerid, params[])
{
if(!PlayerInfo[playerid][power]) return SendClientError(playerid, CANT_USE_CMD);
if(strcmp(glob_toban,"NoBodY", true))
{
return SendClientError(playerid, "Try again in 1 second!");
}
new iPlayer[MAX_PLAYER_NAME], iReason[ 128 ], iFile[64];
GetPlayerName(iPlayer,player,sizeof(player));
if( sscanf ( params, "us", iPlayer, iReason)) return SCP(playerid, "[PlayerID/PartOfName] [reason]");
if(!IsPlayerConnected(iPlayer)) return SendClientError(playerid, PLAYER_NOT_FOUND);
//SendClientMessages, and also kick them, kick before you set their file to banned, because maybe it would lag if u kick them after
format(iFile, sizeof(iFile), "%s.dudb.sav.", iPlayer);
dini_IntSet(iFile,"banned",1);
dini_Set(iFile,"banreason",iReason);
dini_Set(iFile,"whobannedme",PlayerName(playerid));
dini_Set(iFile,"whenigotbanned",TimeDate());\
//format(iStr, sizeof(iStr), "[SUSPEND] by %s. Reason: %s", AnonAdmin(playerid), iReason);
//BanReas(AnonAdmin(playerid),iPlayer,iReason, 0);
return 1;
}