Return SendClientMessage
#1

At this makeleader cmd. how do i make.

If an player is on Normal Civilian/None faction. and if they dont have faction it will return sendclientmessage

Like this: "That player doesnt have any faction!"

For example. You are on Normal Civilian Faction/Faction then i tried to give you again the Civilian Faction. it will return SendClientMessage "That player doesnt have any faction!"

Код:
CMD:makeleader(playerid, params[])
{
	if (PlayerInfo[playerid][pAdmin] >= 1337)
	{
		new string[128], giveplayerid, faction;
		if(sscanf(params, "ud", giveplayerid, faction))
		{
			SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /makeleader [playerid] [factionid]");
			SendClientMessageEx(playerid, COLOR_GRAD3, "0 Normal Civilian |1 LSPD |2 FBI |3 SFPD |4 LSFMD |5 Judicial System");
			SendClientMessageEx(playerid, COLOR_GRAD2, "|6 Government |7 SASD |8 Hitman |9 SA News");
			SendClientMessageEx(playerid, COLOR_GRAD1, "|10 Taxi Company |11 SANG |12 Tierra Robada");
			SendClientMessageEx(playerid, COLOR_GRAD1, "|13 NOOSE |14 Al' Qaeda");
			return 1;
		}
		if(faction > 14 || faction < 0) { SendClientMessageEx(playerid, COLOR_GREY, "   Don't go below number 0, or above number 13!"); return 1; }
		if(IsPlayerConnected(giveplayerid))
		{
			new ftext[30];
			PlayerInfo[giveplayerid][pLeader] = faction;
			PlayerInfo[giveplayerid][pRank] = 6;
			PlayerInfo[giveplayerid][pMember] = faction;
			if(PlayerInfo[giveplayerid][pLeader] == 0) { ftext = "Normal Civilian"; }
			else if(PlayerInfo[giveplayerid][pLeader] == 1) { ftext = "LSPD"; }
			else if(PlayerInfo[giveplayerid][pLeader] == 2) { ftext = "FBI"; }
			else if(PlayerInfo[giveplayerid][pLeader] == 3) { ftext = "SFPD"; }
			else if(PlayerInfo[giveplayerid][pLeader] == 4) { ftext = "LSFMD"; }
			else if(PlayerInfo[giveplayerid][pLeader] == 5) { ftext = "Judicial System"; }
			else if(PlayerInfo[giveplayerid][pLeader] == 6) { ftext = "The Government"; }
			else if(PlayerInfo[giveplayerid][pLeader] == 7) { ftext = "SASD"; }
			else if(PlayerInfo[giveplayerid][pLeader] == 8) { ftext = "Hitman Agency"; }
			else if(PlayerInfo[giveplayerid][pLeader] == 9) { ftext = "SA News"; }
			else if(PlayerInfo[giveplayerid][pLeader] == 10) { ftext = "Taxi Cab Company"; }
			else if(PlayerInfo[giveplayerid][pLeader] == 11) { ftext = "San Andreas National Guard"; }
			else if(PlayerInfo[giveplayerid][pLeader] == 12) { ftext = "Tierra Robada"; }
			else if(PlayerInfo[giveplayerid][pLeader] == 13) { ftext = "NOOSE"; }
			else if(PlayerInfo[giveplayerid][pLeader] == 14) {ftext = "Al' Qaeda"; }
			else { return 1; }

			new kickinfo[128];
			new receivekickinfo[128];
			format(kickinfo, sizeof(kickinfo), "You have kicked %s for being a leader of %s.", GetPlayerNameEx(giveplayerid), ftext);
			format(receivekickinfo, sizeof(receivekickinfo), "You have been kicked for being leader of %s by Adminstrator %s", ftext, GetPlayerNameEx(playerid));
			format(string, sizeof(string), "You have been made the leader of the %s by Administrator %s.",ftext, GetPlayerNameEx(playerid));
			if(PlayerInfo[giveplayerid][pLeader] == 0)
			{
				SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, receivekickinfo);
				SendClientMessageEx(playerid, COLOR_LIGHTBLUE, kickinfo);
			}
			else
			{
			    format(string, sizeof(string), "You have made %s the leader of the %s.", GetPlayerNameEx(giveplayerid),ftext);
				SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
				SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
			}
			if(faction < 4 && faction > 0 || faction > 4 && faction < 7)
			{
				gTeam[giveplayerid] = 2;
				PlayerInfo[giveplayerid][pTeam] = 2;
			}
			PlayerInfo[giveplayerid][pFMember] = 255;
		}
	}
	else
	{
		SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
	}
	return 1;
}
Thank you very much!
Reply
#2

I'm sorry to say but the amount of questions you ask is too damn high

Can't you learn about if else blocks and client messages from the wiki and the millions of tutorials on the forums?
Reply
#3

Quote:
Originally Posted by Rajat_Pawar
Посмотреть сообщение
I'm sorry to say but the amount of questions you ask is too damn high

Can't you learn about if else blocks and client messages from the wiki and the millions of tutorials on the forums?
lol, i tried to add the
Код:
if(PlayerInfo[giveplayerid][pLeader] == 0) return SendClientMessage(playerid, COLOR_WHITE, "That player doesnt have any faction!");
But, it doesnt work it works when im on the Faction 0 its returning

So thats mean when im on the Faction 0. cant make myself anymore at faction
Reply
#4

Код:
CMD:makeleader(playerid, params[])
{
	if (PlayerInfo[playerid][pAdmin] >= 1337)
	{
		new string[128], giveplayerid, faction;
		if(sscanf(params, "ud", giveplayerid, faction))
		{
			SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /makeleader [playerid] [factionid]");
			SendClientMessageEx(playerid, COLOR_GRAD3, "0 Normal Civilian |1 LSPD |2 FBI |3 SFPD |4 LSFMD |5 Judicial System");
			SendClientMessageEx(playerid, COLOR_GRAD2, "|6 Government |7 SASD |8 Hitman |9 SA News");
			SendClientMessageEx(playerid, COLOR_GRAD1, "|10 Taxi Company |11 SANG |12 Tierra Robada");
			SendClientMessageEx(playerid, COLOR_GRAD1, "|13 NOOSE |14 Al' Qaeda");
			return 1;
		}
                if(PlayerInfo[giveplayerid][pLeader] == 0) return  SendClientMessageEx(playerid, 0xFF0000FF,"That player doesnt have any faction!");
		if(faction > 14 || faction < 0) { SendClientMessageEx(playerid, COLOR_GREY, "   Don't go below number 0, or above number 13!"); return 1; }
		if(IsPlayerConnected(giveplayerid))
		{
			new ftext[30];
			PlayerInfo[giveplayerid][pLeader] = faction;
			PlayerInfo[giveplayerid][pRank] = 6;
			PlayerInfo[giveplayerid][pMember] = faction;
			if(PlayerInfo[giveplayerid][pLeader] == 0) { ftext = "Normal Civilian"; }
			else if(PlayerInfo[giveplayerid][pLeader] == 1) { ftext = "LSPD"; }
			else if(PlayerInfo[giveplayerid][pLeader] == 2) { ftext = "FBI"; }
			else if(PlayerInfo[giveplayerid][pLeader] == 3) { ftext = "SFPD"; }
			else if(PlayerInfo[giveplayerid][pLeader] == 4) { ftext = "LSFMD"; }
			else if(PlayerInfo[giveplayerid][pLeader] == 5) { ftext = "Judicial System"; }
			else if(PlayerInfo[giveplayerid][pLeader] == 6) { ftext = "The Government"; }
			else if(PlayerInfo[giveplayerid][pLeader] == 7) { ftext = "SASD"; }
			else if(PlayerInfo[giveplayerid][pLeader] == 8) { ftext = "Hitman Agency"; }
			else if(PlayerInfo[giveplayerid][pLeader] == 9) { ftext = "SA News"; }
			else if(PlayerInfo[giveplayerid][pLeader] == 10) { ftext = "Taxi Cab Company"; }
			else if(PlayerInfo[giveplayerid][pLeader] == 11) { ftext = "San Andreas National Guard"; }
			else if(PlayerInfo[giveplayerid][pLeader] == 12) { ftext = "Tierra Robada"; }
			else if(PlayerInfo[giveplayerid][pLeader] == 13) { ftext = "NOOSE"; }
			else if(PlayerInfo[giveplayerid][pLeader] == 14) {ftext = "Al' Qaeda"; }
			else { return 1; }

			new kickinfo[128];
			new receivekickinfo[128];
			format(kickinfo, sizeof(kickinfo), "You have kicked %s for being a leader of %s.", GetPlayerNameEx(giveplayerid), ftext);
			format(receivekickinfo, sizeof(receivekickinfo), "You have been kicked for being leader of %s by Adminstrator %s", ftext, GetPlayerNameEx(playerid));
			format(string, sizeof(string), "You have been made the leader of the %s by Administrator %s.",ftext, GetPlayerNameEx(playerid));
			if(PlayerInfo[giveplayerid][pLeader] == 0)
			{
				SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, receivekickinfo);
				SendClientMessageEx(playerid, COLOR_LIGHTBLUE, kickinfo);
			}
			else
			{
			    format(string, sizeof(string), "You have made %s the leader of the %s.", GetPlayerNameEx(giveplayerid),ftext);
				SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
				SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
			}
			if(faction < 4 && faction > 0 || faction > 4 && faction < 7)
			{
				gTeam[giveplayerid] = 2;
				PlayerInfo[giveplayerid][pTeam] = 2;
			}
			PlayerInfo[giveplayerid][pFMember] = 255;
		}
	}
	else
	{
		SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
	}
	return 1;
}
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)