Warning/Kick system problems.
#1

Hello guys, i hate my Warning system and kick system is on PPC Trucking i thing much people know it, i want another one like Ladmin can anyone make me me? her are codes of Warn/Kick
Warn one:
Код:
// Warn a player
COMMAND:warn(playerid, params[])
{
	new PlayerToWarn, Reason[128], ReasonMsg[128], Name[24];

	// Send the command to all admins so they can see it
	SendAdminText(playerid, "/warn", params);

	// Check if the player has logged in
	if (APlayerData[playerid][LoggedIn] == true)
	{
		// Check if the player's admin-level is at least 1
		if (APlayerData[playerid][PlayerLevel] >= 1)
		{
			if (sscanf(params, "us[128]", PlayerToWarn, Reason)) SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/warn <PlayerToWarn> <Reason>\"");
			else
				if (IsPlayerConnected(PlayerToWarn)) // If the player is a valid playerid (he's connected)
				{
					// Increase the number of warnings
					APlayerData[PlayerToWarn][Warnings]++;

					// Get the name of the player who warned the player
					GetPlayerName(playerid, Name, sizeof(Name));
					// Send the warned player a message who warned him and why he's been warned
					format(ReasonMsg, 128, "You have been warned by %s %s", AdminLevelName[APlayerData[playerid][PlayerLevel]], Name);
					SendClientMessage(PlayerToWarn, 0xFF0000FF, ReasonMsg);
					format(ReasonMsg, 128, "Reason: %s", Reason);
					SendClientMessage(PlayerToWarn, 0xFF0000FF, ReasonMsg);
					format(ReasonMsg, 128, "~w~Warning %i/%i: ~r~%s~w~", APlayerData[PlayerToWarn][Warnings], AutoKickWarnings, Reason);
					GameTextForPlayer(PlayerToWarn, ReasonMsg, 5000, 4);

					// Get the name of the warned player
					GetPlayerName(PlayerToWarn, Name, sizeof(Name));
					// Let the admin know who has been warned and why
					format(ReasonMsg, 128, "You have warned %s (warnings: %i/%i)", Name, APlayerData[PlayerToWarn][Warnings], AutoKickWarnings);
					SendClientMessage(playerid, 0x00FF00FF, ReasonMsg);
					format(ReasonMsg, 128, "Reason: %s", Reason);
					SendClientMessage(playerid, 0xFF0000FF, ReasonMsg);

					// Automatically kick the player if he got 3 warnings (if autokick is enabled)
					if ((APlayerData[PlayerToWarn][Warnings] == AutoKickWarnings) && (AutoKickAfterWarn == 1))
						Kick(PlayerToWarn);
				}
				else
				    SendClientMessage(playerid, 0xFF0000FF, "That player isn't online");
		}
		else
		    return 0;
	}
	else
	    return 0;

	// Let the server know that this was a valid command
	return 1;
}
Kick:
Код:
// Kicks a player with a reason
COMMAND:kick(playerid, params[])
{
	new PlayerToKick, Reason[128], ReasonMsg[128], Name[24];

	// Send the command to all admins so they can see it
	SendAdminText(playerid, "/kick", params);

	// Check if the player has logged in
	if (APlayerData[playerid][LoggedIn] == true)
	{
		// Check if the player's admin-level is at least 1
		if (APlayerData[playerid][PlayerLevel] >= 1)
		{
			if (sscanf(params, "us[128]", PlayerToKick, Reason)) SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/kick <PlayerToKick> <Reason>\"");
			else
				if (IsPlayerConnected(PlayerToKick)) // If the player is a valid playerid (he's connected)
				{
					// Get the name of the player who warned the player
					GetPlayerName(playerid, Name, sizeof(Name));
					// Send the warned player a message who kicked him and why he's been kicked
					format(ReasonMsg, 128, "You have been kicked by %s %s", AdminLevelName[APlayerData[playerid][PlayerLevel]], Name);
					SendClientMessage(PlayerToKick, 0xFF0000FF, ReasonMsg);
					format(ReasonMsg, 128, "Reason: %s", Reason);
					SendClientMessage(PlayerToKick, 0xFF0000FF, ReasonMsg);
					// Kick the player
					Kick(PlayerToKick);
				}
				else
				    SendClientMessage(playerid, 0xFF0000FF, "That player isn't online");
		}
		else
		    return 0;
	}
	else
	    return 0;

	// Let the server know that this was a valid command
	return 1;
}
I thing guys u know ladmin if u dont know it i will give codes of Ladmin warn/kick one guy try to help me bt get much errors. +1 REP for this who help me, Thanks much !
Reply


Messages In This Thread
Warning/Kick system problems. - by [FoR]EveR - 30.08.2013, 13:54
Re: Warning/Kick system problems. - by DanishHaq - 30.08.2013, 13:56
Re: Warning/Kick system problems. - by kingofdemons - 30.08.2013, 13:57
Re: Warning/Kick system problems. - by [FoR]EveR - 30.08.2013, 14:26
Re: Warning/Kick system problems. - by kingofdemons - 30.08.2013, 15:02
Re: Warning/Kick system problems. - by [FoR]EveR - 30.08.2013, 15:13
Re: Warning/Kick system problems. - by [FoR]EveR - 31.08.2013, 08:27
Re: Warning/Kick system problems. - by Skribblez - 31.08.2013, 08:41
Re: Warning/Kick system problems. - by [FoR]EveR - 31.08.2013, 09:39
Re: Warning/Kick system problems. - by [FoR]EveR - 31.08.2013, 09:42

Forum Jump:


Users browsing this thread: 4 Guest(s)