Add a %s
#1

I want to do so that the example is this: AdmCmd: %s was kicked by Senior Admin %s, reason: %s

Please explain how i can do this in other cmd

Код:
CMD:kick(playerid, params[])
{
	if (PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pHelper] >= 4)
	{
		new string[128], giveplayerid, reason[64];
		if(sscanf(params, "us[64]", giveplayerid, reason)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /kick [playerid] [reason]");

		if(IsPlayerConnected(giveplayerid))
		{
			if(PlayerInfo[giveplayerid][pAdmin] >= PlayerInfo[playerid][pAdmin] && (PlayerInfo[giveplayerid][pHelper] >= 2 || PlayerInfo[giveplayerid][pAdmin] > 0) && playerid != giveplayerid)
			{
				format(string, sizeof(string), "AdmCmd: %s has been auto-kicked, reason: Trying to /kick a higher admin.", GetPlayerNameEx(playerid));
				ABroadCast(COLOR_YELLOW,string, (PlayerInfo[playerid][pAdmin] == 1) ? (1) : (2));
				Kick(playerid);
				return 1;
			}
			else
			{
				new year, month,day;
				getdate(year, month, day);
				new playerip[32];
				GetPlayerIp(giveplayerid, playerip, sizeof(playerip));
				format(string, sizeof(string), "AdmCmd: %s (IP:%s) was kicked by %s, reason: %s (%d-%d-%d)", GetPlayerNameEx(giveplayerid), playerip, GetPlayerNameEx(playerid), reason,month,day,year);
				Log("logs/kick.log", string);
				if(PlayerInfo[playerid][pAdmin] == 1) Log("logs/moderator.log", string);
				format(string, sizeof(string), "AdmCmd: %s was kicked by %s, reason: %s", GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid), reason);
				SendClientMessageToAllEx(COLOR_LIGHTRED, string);
				Kick(giveplayerid);
			}
			return 1;
		}
	}
	else SendClientMessageEx(playerid, COLOR_GRAD1, "Invalid player specified.");
	return 1;
}
Reply
#2

Код:
CMD:kick(playerid, params[])
{
	if (PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pHelper] >= 4)
	{
		new string[128], giveplayerid, reason[64];
		if(sscanf(params, "us[64]", giveplayerid, reason)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /kick [playerid] [reason]");

		if(IsPlayerConnected(giveplayerid))
		{
			if(PlayerInfo[giveplayerid][pAdmin] >= PlayerInfo[playerid][pAdmin] && (PlayerInfo[giveplayerid][pHelper] >= 2 || PlayerInfo[giveplayerid][pAdmin] > 0) && playerid != giveplayerid)
			{
				format(string, sizeof(string), "AdmCmd: %s has been auto-kicked, reason: Trying to /kick a higher admin.", GetPlayerNameEx(playerid));
				ABroadCast(COLOR_YELLOW,string, (PlayerInfo[playerid][pAdmin] == 1) ? (1) : (2));
				Kick(playerid);
				return 1;
			}
			else
			{
				new year, month,day;
				getdate(year, month, day);
				new playerip[32];
				GetPlayerIp(giveplayerid, playerip, sizeof(playerip));
				format(string, sizeof(string), "AdmCmd: %s (IP:%s) was kicked by %s, reason: %s (%d-%d-%d)", GetPlayerNameEx(giveplayerid), playerip, GetPlayerNameEx(playerid), reason,month,day,year);
				Log("logs/kick.log", string);
				if(PlayerInfo[playerid][pAdmin] == 1) Log("logs/moderator.log", string);
	if(PlayerInfo[playerid][pAdmin] == 1)
	{
		format(string, sizeof(string), "AdmCmd: %s was kicked by Server Moderator %s, reason: %s", GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid), reason);
		SendClientMessageToAllEx(COLOR_LIGHTRED, string);
		Kick(giveplayerid);
	}
else if(PlayerInfo[playerid][pAdmin] == 2)
    {
        format(string, sizeof(string), "AdmCmd: %s was kicked by Junior Admin %s, reason: %s", GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid), reason);
		SendClientMessageToAllEx(COLOR_LIGHTRED, string);
		Kick(giveplayerid);
    }
        else if(PlayerInfo[playerid][pAdmin] == 3)
    {
        format(string, sizeof(string), "AdmCmd: %s was kicked by General Admin %s, reason: %s", GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid), reason);
		SendClientMessageToAllEx(COLOR_LIGHTRED, string);
		Kick(giveplayerid);
    }
        else if(PlayerInfo[playerid][pAdmin] >= 4 && PlayerInfo[playerid][pAdmin] < 1337)
    {
        format(string, sizeof(string), "AdmCmd: %s was kicked by Senior Admin %s, reason: %s", GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid), reason);
		SendClientMessageToAllEx(COLOR_LIGHTRED, string);
		Kick(giveplayerid);
    }
        else if(PlayerInfo[playerid][pAdmin] == 1337)
    {
        format(string, sizeof(string), "AdmCmd: %s was kicked by Head Admin %s, reason: %s", GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid), reason);
		SendClientMessageToAllEx(COLOR_LIGHTRED, string);
		Kick(giveplayerid);
    }
        else if(PlayerInfo[playerid][pAdmin] >= 1338 && PlayerInfo[playerid][pAdmin] < 99998)
    {
        format(string, sizeof(string), "AdmCmd: %s was kicked by Community Manager %s, reason: %s", GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid), reason);
		SendClientMessageToAllEx(COLOR_LIGHTRED, string);
		Kick(giveplayerid);
    }
        else if(PlayerInfo[playerid][pAdmin] == 99998)
    {
        format(string, sizeof(string), "AdmCmd: %s was kicked by Server Co Owner %s, reason: %s", GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid), reason);
		SendClientMessageToAllEx(COLOR_LIGHTRED, string);
		Kick(giveplayerid);
    }
        else if(PlayerInfo[playerid][pAdmin] == 99999)
    {
        format(string, sizeof(string), "AdmCmd: %s was kicked by Server Owner %s, reason: %s", GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid), reason);
		SendClientMessageToAllEx(COLOR_LIGHTRED, string);
		Kick(giveplayerid);
    }
			}
			return 1;
		}
	}
	else SendClientMessageEx(playerid, COLOR_GRAD1, "Invalid player specified.");
	return 1;
}
Untested, if its helped you so if you can +rep
Reply
#3

Quote:
Originally Posted by Nivniv2
Посмотреть сообщение
Код:
CMD:kick(playerid, params[])
{
	if (PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pHelper] >= 4)
	{
		new string[128], giveplayerid, reason[64];
		if(sscanf(params, "us[64]", giveplayerid, reason)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /kick [playerid] [reason]");

		if(IsPlayerConnected(giveplayerid))
		{
			if(PlayerInfo[giveplayerid][pAdmin] >= PlayerInfo[playerid][pAdmin] && (PlayerInfo[giveplayerid][pHelper] >= 2 || PlayerInfo[giveplayerid][pAdmin] > 0) && playerid != giveplayerid)
			{
				format(string, sizeof(string), "AdmCmd: %s has been auto-kicked, reason: Trying to /kick a higher admin.", GetPlayerNameEx(playerid));
				ABroadCast(COLOR_YELLOW,string, (PlayerInfo[playerid][pAdmin] == 1) ? (1) : (2));
				Kick(playerid);
				return 1;
			}
			else
			{
				new year, month,day;
				getdate(year, month, day);
				new playerip[32];
				GetPlayerIp(giveplayerid, playerip, sizeof(playerip));
				format(string, sizeof(string), "AdmCmd: %s (IP:%s) was kicked by %s, reason: %s (%d-%d-%d)", GetPlayerNameEx(giveplayerid), playerip, GetPlayerNameEx(playerid), reason,month,day,year);
				Log("logs/kick.log", string);
				if(PlayerInfo[playerid][pAdmin] == 1) Log("logs/moderator.log", string);
	if(PlayerInfo[playerid][pAdmin] == 1)
	{
		format(string, sizeof(string), "AdmCmd: %s was kicked by Server Moderator %s, reason: %s", GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid), reason);
		SendClientMessageToAllEx(COLOR_LIGHTRED, string);
		Kick(giveplayerid);
	}
else if(PlayerInfo[playerid][pAdmin] == 2)
    {
        format(string, sizeof(string), "AdmCmd: %s was kicked by Junior Admin %s, reason: %s", GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid), reason);
		SendClientMessageToAllEx(COLOR_LIGHTRED, string);
		Kick(giveplayerid);
    }
        else if(PlayerInfo[playerid][pAdmin] == 3)
    {
        format(string, sizeof(string), "AdmCmd: %s was kicked by General Admin %s, reason: %s", GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid), reason);
		SendClientMessageToAllEx(COLOR_LIGHTRED, string);
		Kick(giveplayerid);
    }
        else if(PlayerInfo[playerid][pAdmin] >= 4 && PlayerInfo[playerid][pAdmin] < 1337)
    {
        format(string, sizeof(string), "AdmCmd: %s was kicked by Senior Admin %s, reason: %s", GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid), reason);
		SendClientMessageToAllEx(COLOR_LIGHTRED, string);
		Kick(giveplayerid);
    }
        else if(PlayerInfo[playerid][pAdmin] == 1337)
    {
        format(string, sizeof(string), "AdmCmd: %s was kicked by Head Admin %s, reason: %s", GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid), reason);
		SendClientMessageToAllEx(COLOR_LIGHTRED, string);
		Kick(giveplayerid);
    }
        else if(PlayerInfo[playerid][pAdmin] >= 1338 && PlayerInfo[playerid][pAdmin] < 99998)
    {
        format(string, sizeof(string), "AdmCmd: %s was kicked by Community Manager %s, reason: %s", GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid), reason);
		SendClientMessageToAllEx(COLOR_LIGHTRED, string);
		Kick(giveplayerid);
    }
        else if(PlayerInfo[playerid][pAdmin] == 99998)
    {
        format(string, sizeof(string), "AdmCmd: %s was kicked by Server Co Owner %s, reason: %s", GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid), reason);
		SendClientMessageToAllEx(COLOR_LIGHTRED, string);
		Kick(giveplayerid);
    }
        else if(PlayerInfo[playerid][pAdmin] == 99999)
    {
        format(string, sizeof(string), "AdmCmd: %s was kicked by Server Owner %s, reason: %s", GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid), reason);
		SendClientMessageToAllEx(COLOR_LIGHTRED, string);
		Kick(giveplayerid);
    }
			}
			return 1;
		}
	}
	else SendClientMessageEx(playerid, COLOR_GRAD1, "Invalid player specified.");
	return 1;
}
Untested, if its helped you so if you can +rep
Thanks, i did work!
how did u do, explain please
Reply
#4

use
Код:
 else if(PlayerInfo[playerid][pAdmin] == -admin level-)
and then write the things that will happen if the admin level above doing the command
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)