SA-MP Forums Archive
CMD:tempban problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: CMD:tempban problem (/showthread.php?tid=567637)



CMD:tempban problem - Fantje - 15.03.2015

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;




Re: CMD:tempban problem - ATGOggy - 15.03.2015

Are you sure that you set the admin's PVar?


Re: CMD:tempban problem - Fantje - 15.03.2015

What you mean?