CMD:tempban problem
#1

Heey guys,

I am admin and when I type /tempban I get: Only admins can use this command.

The command code:
PHP код:
CMD:tempban(playeridparams[]) {
    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(playeridCOLOR"Only admins can use this command.");
    if(
sscanf(params"udddddds"iTargetiYearsiMonthsiWeeksiDaysiHoursiMinutesszReason))
        return 
SendClientMessage(playeridCOLOR"Syntax: {FFFFFF}/tempban [playerid] [years] [months] [weeks] [days] [hours] [minutes] [reason]");
    
iFinalCalculation gettime() + mktime(iHoursiMinutes0iDaysiMonthsiYears);
        
    if(
gettime() == iFinalCalculation)
        return 
SendClientMessage(playeridCOLOR"You haven't set a proper unban date.");
    
GetPlayerName(playeridszPlayerNameMAX_PLAYER_NAME);
    
GetPlayerIp(iTargetszIPsizeof(szIP));
        
    
tempBanPlayer(iTargetiFinalCalculationszPlayerNameszReasonszIP);
        
    return 
1;

Reply
#2

Are you sure that you set the admin's PVar?
Reply
#3

What you mean?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)