SA-MP Forums Archive
Disable help - 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: Disable help (/showthread.php?tid=544948)



Disable help - earlybird325 - 05.11.2014

Ok, I have a account disable system. How can I make it where disables are removed automatically after the time is up like

PHP код:
dcmd_disable(playerid,params[])
{
    new 
id,days,reason[128];
     if(
sscanf(params"uds[128]"iddaysreason)) return SendClientMessage(playeridCOLOR_RED"USAGE: /disable id reason");
    else
   {
     
playerinfo[id][disabled] =1;
     
playerinfo[id][disabledays] =days;
     
SendClientMessage(playerid,-1,"You have been disabled.");
     
Kick(playerid);
   }
    return 
1;

I use yini for accounts


Re: Disable help - Mitchelll - 05.11.2014

Make two option in user's account file 'AccountDisableDate' & 'AccountDisableRe' then set a script if the 'AccountDisableDate' matches with the current date of the day then set the 'AccountDisableRe' to 0.

Код:
AccountDisableDate is used to have date of the day to remove account disable.
AccountDisableRe is used to know if account is disabled or not.
[EDIT]

Oh i almost forgot, add some changes in disable command too.
Add a y_ini script to set AccountDisableDate and AccountDisableRe in user's account file.
At last, you may kick player or not.