ned help with /setleader
#5

Код:
}
	if(strcmp(cmd, "/makeleader", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_WHITE, "USAGE: /makeleader [playerid/PartOfName] [number]");
				return 1;
			}
			new para1;
			para1 = ReturnUser(tmp);
			if(IsPlayerNPC(para1)) return 1;
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_WHITE, "USAGE: /makeleader [playerid/PartOfName] [number]");
				return 1;
			}
			new faction;
			faction = strvalEx(tmp);
			if(faction < 0 || faction > 12) { SendClientMessage(playerid, COLOR_GREY, "   Dont go below number 0, or above number 12 !"); return 1; }
			if(PlayerInfo[playerid][pAdmin] >= 1337 || (PlayerInfo[playerid][pFactionMod]))
			{
			    if(IsPlayerConnected(para1))
			    {
			        if(para1 != INVALID_PLAYER_ID)
			        {
			            new ftext[20];
			            GetPlayerName(playerid, sendername, sizeof(sendername));
			            GetPlayerName(para1, giveplayer, sizeof(giveplayer));
						if(faction == 0) { PlayerInfo[para1][pModel] = 299; PlayerInfo[para1][pRank] = 0; ftext = "None"; }
						else if(faction == 1) { PlayerInfo[para1][pModel] = 265; PlayerInfo[para1][pRank] = 6; ftext = "Police Force"; }
						else if(faction == 2) { PlayerInfo[para1][pModel] = 286; PlayerInfo[para1][pRank] = 6; ftext = "FBI"; }
						else if(faction == 3) { PlayerInfo[para1][pModel] = 288; PlayerInfo[para1][pRank] = 6; ftext = "SASP"; }
						else if(faction == 4) { PlayerInfo[para1][pModel] = 274; PlayerInfo[para1][pRank] = 6; ftext = "Firemen/Ambulance"; }
						else if(faction == 5) { PlayerInfo[para1][pModel] = 287; PlayerInfo[para1][pRank] = 6; ftext = "National Guards"; }
						else if(faction == 6) { PlayerInfo[para1][pModel] = 147; PlayerInfo[para1][pRank] = 6; ftext = "Senate"; }
						else if(faction == 7) { PlayerInfo[para1][pModel] = 165; PlayerInfo[para1][pRank] = 6; ftext = "Secret Society"; }
						else if(faction == 8) { PlayerInfo[para1][pModel] = 294; PlayerInfo[para1][pRank] = 6; ftext = "Hitman Agency"; }
						else if(faction == 9) { PlayerInfo[para1][pModel] = 227; PlayerInfo[para1][pRank] = 8; ftext = "News Agency"; }
						else if(faction == 10) { PlayerInfo[para1][pModel] = 61; PlayerInfo[para1][pRank] = 6; ftext = "Taxi Cab Company"; }
						else if(faction == 11) { PlayerInfo[para1][pModel] = 240; PlayerInfo[para1][pRank] = 6; ftext = "Administrators"; }
						else if(faction == 12) { PlayerInfo[para1][pModel] = 240; PlayerInfo[para1][pRank] = 6; ftext = "Airforce"; }
						format(string, sizeof(string), "* You have given %s leadership of the %s.", giveplayer,ftext);
						SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
						format(string, sizeof(string), "* %s has given you leadership of the %s.",sendername,ftext);
						SendClientMessage(para1, COLOR_LIGHTBLUE, string);
						PlayerInfo[para1][pLeader] = faction;
						PlayerInfo[para1][pMember] = faction;
					    SetPlayerSkin(para1, PlayerInfo[para1][pModel]);
					    SetPlayerToTeamColor(playerid);
					    OnPlayerSave(para1);
					}
				}
			}
			else
			{
			SendClientMessage(playerid, COLOR_GRAD1, "   You are not authorized to use that command !");
			}
		}
		return 1;
This is the system I have in mine just remove the case 11 and case 12 because those are two custom factions I made, but I am not sure if it will work for you because I may have diffrent admin stuff ect. Try it out.

Hope I helped.

[EDIT] Just re read your code and mine probably isn't going to help you, sorry I tried.
Reply


Messages In This Thread
ned help with /setleader - by cruising - 10.10.2011, 06:49
Re: ned help with /setleader - by TheLazySloth - 10.10.2011, 06:53
Re: ned help with /setleader - by cruising - 10.10.2011, 06:59
Re: ned help with /setleader - by cruising - 12.10.2011, 00:12
Re: ned help with /setleader - by Tye Huntley - 13.10.2011, 02:31
Re: ned help with /setleader - by cruising - 13.10.2011, 02:38

Forum Jump:


Users browsing this thread: 1 Guest(s)