15.03.2015, 14:43
Heey guys,
I am admin and when I type /tempban I get: Only admins can use this command.
The command code:
I am admin and when I type /tempban I get: Only admins can use this command.
The command code:
PHP код:
CMD:tempban(playerid, params[]) {
new
iYears,
iMonths,
iDays,
iFinalCalculation,
iHours,
iWeeks,
szReason[32],
iMinutes,
szIP[19],
szPlayerName[MAX_PLAYER_NAME],
iTarget;
if(!IsPlayerAdmin(playerid) && GetPVarInt(playerid, "Admin") <= 0) /* set a PVar in your mode for 'Admin' to integrate this into a GM */
return SendClientMessage(playerid, COLOR, "Only admins can use this command.");
if(sscanf(params, "udddddds", iTarget, iYears, iMonths, iWeeks, iDays, iHours, iMinutes, szReason))
return SendClientMessage(playerid, COLOR, "Syntax: {FFFFFF}/tempban [playerid] [years] [months] [weeks] [days] [hours] [minutes] [reason]");
iFinalCalculation = gettime() + mktime(iHours, iMinutes, 0, iDays, iMonths, iYears);
if(gettime() == iFinalCalculation)
return SendClientMessage(playerid, COLOR, "You haven't set a proper unban date.");
GetPlayerName(playerid, szPlayerName, MAX_PLAYER_NAME);
GetPlayerIp(iTarget, szIP, sizeof(szIP));
tempBanPlayer(iTarget, iFinalCalculation, szPlayerName, szReason, szIP);
return 1;
}