Jump to content
  • 0

Poate da crash?


Paul.eboy

Question

if(strcmp(cmd, "/ban", true) == 0)
{
	new reason[256];
	if (Admin[playerid] < 4 && !IsPlayerAdmin(playerid)) return SendClientMessage(playerid, RED, "You are not an admin with the required level.");

	tmp = strtok(cmdtext, idx);

	if(!strlen(tmp)) return SendClientMessage(playerid, ORANGE, "USAGE: /ban [playerid] [reason]");

	giveplayerid = ReturnUser(tmp);

	if(giveplayerid == INVALID_PLAYER_ID)
	{
		format(string, sizeof(string), "%s is not an active player.", tmp);
		SendClientMessage(playerid, RED, string);
		return 1;
	}

	GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
	GetPlayerName(playerid, sendername, sizeof(sendername));

	new length = strlen(cmdtext);

	while ((idx < length) && (cmdtext[idx] <= ' '))
	{
		idx++;
	}
	new offset = idx;
	while ((idx < length) && ((idx - offset) < (sizeof(reason) - 1)))
	{
		reason[idx - offset] = cmdtext[idx];
		idx++;
	}
	reason[idx - offset] = EOS;

	if(!strlen(reason)) return SendClientMessage(playerid, ORANGE, "USAGE: /ban [playerid] [reason]");
	else
	{
		new sstring[256];
		new ip[128];
		new name[50];
		GetPlayerName(giveplayerid,name,50);
		strins(name,"users/",0);
		dini_IntSet(name,"Banned",1);
		dini_Set(name,"BanReason",reason);
		SendClientMessage(giveplayerid, -1, "Go on our site for unban: {FF0000}http://cls.irc.su");
		Kick(giveplayerid);
		format(string,sizeof(string),"*** BAN: %s has been banned by Admin %s (%s)",giveplayer,sendername,reason);
		printf(string);
		SendClientMessageToAll(COLOR_SYSTEM,string);
		TogglePlayerControllable(giveplayerid,0);
		BanLog(string);
		GetPlayerIp(giveplayerid,ip,128);
		format(sstring, sizeof(sstring),"Player's IP: %s",ip);
		SendClientMessageToAdmins(COLOR_SYSTEM,sstring,1);
	}
	return 1;
}

Uitati-va putin la

"Kick(giveplayerid);"

desi e /ban,acolo e Kick(giveplayerid);..

poate da crash  de la asta?

Daca pun Bangiveplayerid);cand dau ban cuiva,da ban pe clasa IP.. (sau ceva de genul)

www.uifserver.net

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.