HEEEEEEEEEEEEEEEEEEEELP! I'm give you rep+!
#1

I'm created a /ban command and i'm not know how to save timer and banned player with dini...
Код:
dcmd_ban(playerid, params[])
{
	if(AccountInfo[playerid][aLevel] < 1) SendClientMessage(playerid, COLOR_RED, "Ai nevoie de admin 1 pentru a folosii aceasta comanda!");
    else
	{
	    new ore = 60000;
	    new ID, reason[100], name[60], name2[60], string4[256], string5[256], string6[256], string2[256];
	    if(sscanf(params, "iis", ID, ore, reason)) SendClientMessage(playerid, COLOR_WHITE, "Scrie: /ban [id/nume] [zile] [motiv]");
	    else if(IsPlayerConnected(ID) == 0) SendClientMessage(playerid, COLOR_RED, "Player-ul nu este conectat");
	    else
		{
			AccountInfo[ID][pBanned] = 1;
			new zi = floatround(float(ore)/24.0);
			SetTimer("ban1",zi,1);
			SetTimer("kicktimer",2500,1);
			GetPlayerName(playerid, name, 60);
			GetPlayerName(playerid, name2, 60);
			format(string2, 256, "Admin %s[%d] ia dat ban lui %s pentru %s zile. (Motiv: %s)", name, playerid, name2, zi, reason);
	        SendClientMessageToAll(COLOR_LIGHTRED, string2);
			format(string4, 256, "Admin %s[%d] ti-a dat ban pentru %s zile. (Motiv: %s)", name, playerid, zi, reason);
	        SCM(ID, COLOR_YELLOW, string4);
	        format(string5, 256, "Daca crezi ca ai luat ban degeaba poti face o cerere de unban pe:");
	        SCM(ID, COLOR_YELLOW, string5);
	        format(string6, 256, "http://cnrromania.1to.us/index.php?topic=3.0");
	        SCM(ID, COLOR_YELLOW, string6);
	        FixedBan(ID);
		 	}
  	}
	return 1;
}
THANKS!
Reply
#2

Stop double posting and creating so many threads related to the same issue, this way you might get banished! There's no need to write in red, you're going to hurt our eyes. Thread's title should contain information related to the issue, not non-sense words. Read the rules before posting, please.

Back to the topic, check the tutorials thread, there are many dini tutorials. There are also a lot of released scripts which do what you're looking for.
Reply
#3

Quote:
Originally Posted by RIDE2DAY
Посмотреть сообщение
Stop double posting and creating so many threads related to the same issue, this way you might get banished! There's no need to write in red, you're going to hurt our eyes. Thread's title should contain information related to the issue, not non-sense words. Read the rules before posting, please.

Back to the topic, check the tutorials thread, there are many dini tutorials. There are also a lot of released scripts which do what you're looking for.
Ok, sorry
Reply
#4

Download TimestampToDate include

Then just save the current timestamp when an admin types the command to ban him, and the second time stamp.
Like you know 1 hour is 60 seconds * 60 minutes

So 1 hour is 3600 seconds

Make a command with sscanf and let the admin type the number of hours

Then do
Secondtimestamp = gettime() + hours*3600;

And save it

When a player logs in, do this

if(secondtimestamp < gettime() )
Then their ban expired, if not kick them
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)