accountdisable - 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: accountdisable (
/showthread.php?tid=497929)
accountdisable -
AroseKhanNiazi - 01.03.2014
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;
}
Re: accountdisable -
ikbenremco - 01.03.2014
Great tutorial:
https://sampforum.blast.hk/showthread.php?tid=254915
Re: accountdisable -
AroseKhanNiazi - 01.03.2014
thanks but i didn't get it can i add inn this
Re: accountdisable -
Zex Tan - 01.03.2014
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.
Re: accountdisable -
AroseKhanNiazi - 01.03.2014
no man i want this like a temporary ban
Re: accountdisable -
AroseKhanNiazi - 02.03.2014
Anyone PLz help
Re: accountdisable -
BroZeus - 02.03.2014
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
}