accountdisable
#1

how can i add a date till when it should be disabled
Код:
dcmd_accountdisable(playerid, params[])
{
        new TargetID,Reason[64];
        if(pInfo[playerid][Adminlevel] < 5) return SendClientMessage(playerid, COLOR_RED, ""ERROR_MESSAGE"");
        if(sscanf(params, "us", TargetID, Reason)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /accountdisable [id] [Reason] [days]");
        if(TargetID == INVALID_PLAYER_ID || !IsPlayerConnected(TargetID )) return SendClientMessage(playerid, COLOR_RED, "* Player Is Not Connected.");
        else
        {
               pInfo[TargetID][Adisable] =1;
               new str[128],str1[128],str2[128];
               new targetname[MAX_PLAYER_NAME];
               GetPlayerName(TargetID,targetname,24);
               format(str,sizeof(str),"%s (%d) Has Been Disabled By An Admin. Reason: %s", targetname, TargetID, Reason);
               SendClientMessageToAll(COLOR_HOTPINK, str);
               format(str1,sizeof(str1),"**KICK: %s (%d) (ACCOUNT DISABLED) Account Disabled", targetname, TargetID);
               SendClientMessageToAll(COLOR_HOTPINK, str1);
               format(str2,sizeof(str2),"This Account Has Been Disabled By An Admin");
               KickWithMessage(COLOR_HOTPINK, str2);
               print(str);
               print(str1);
        }
        return 1;
}
Reply
#2

Great tutorial: https://sampforum.blast.hk/showthread.php?tid=254915
Reply
#3

thanks but i didn't get it can i add inn this
Reply
#4

Then you should atleast learn how to read first before you could do something with it. Use gettime() > add amount of seconds (Forwarding the current day to a certain day/time) > Once a player joined the server, set its variable > Tell the player that his admin/account/vip is expired.
Reply
#5

no man i want this like a temporary ban
Reply
#6

Anyone PLz help
Reply
#7

you can use like this in under the command;-
assuming that number of players that player has to be banned is to be stored in varable 'du'
pawn Код:
new expire;
expire = getime() + (60*60*24*du);
//now save the variable 'expire' in a file using whatever u use
now OnPlayerConnect() use this--
pawn Код:
//first load the variable stored earlier and assuming that the variable is loaded in expire use this
if(getime()<expire)
{
SendClientMessage(playerid,-1,"You are abnned from this server");
Kick(playerid);
}
else
{
//your login procedure
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)