Invalid faction id??
#1

I used this RP-base http://forum.sa-mp.com/showthread.ph...highlight=ugrp

and when I do /makeleader 2 1 it says invalid faction

how do I fix this?
Reply
#2

Show us the /makeleader command please, and next time you can post in the Scripting Help sub-forum.
Reply
#3

sorry for double post
Reply
#4

Quote:
Originally Posted by DanishHaq
Посмотреть сообщение
Show us the /makeleader command please, and next time you can post in the Scripting Help sub-forum.
yes ofcourse sorry, here is the lines
Код:
	if(strcmp(cmd, "/makeleader", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SyntaxMessage(playerid, "/makeleader [playerid/name] [number]");
				return 1;
			}
			new para1;
			para1 = ReturnUser(tmp);
			if(IsPlayerNPC(para1)) return 1;
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SyntaxMessage(playerid, "/makeleader [playerid/name] [number]");
				return 1;
			}
			new faction;
			faction = strval(tmp);
			if(faction < 0 || faction > MAX_FACTIONS) { format(string, sizeof(string), "Faction ID can't be below 0 or above %d.", MAX_FACTIONS); SendClientMessage(playerid, GREY, string); return 1; }
			if(faction != 0 && !FactionInfo[faction][FactionExists]) return SendClientMessage(playerid, GREY, "Invalid faction ID.");
			if(PlayerInfo[playerid][pAdmin] >= 99999 || PlayerInfo[playerid][pFactionMod] > 0)
			{
			    if(IsPlayerConnected(para1))
			    {
			        if(para1 != INVALID_PLAYER_ID)
			        {
			            GetPlayerName(playerid, sendername, sizeof(sendername));
			            GetPlayerName(para1, giveplayer, sizeof(giveplayer));
						PlayerInfo[para1][pRank] = (faction) ? (6) : (0);
						MakeLeaderOf(para1, faction);
						format(string, sizeof(string), "WARNING :- You have given %s the leadership-badge of the %s orgnizaiton.", giveplayer,FactionInfo[faction][FactionName]);
						SendClientMessage(playerid, LIGHTBLUE, string);
						format(string, sizeof(string), "WARNING :- Adminstrator %s has given you the leadership-badge of the %s orgnization.",sendername,FactionInfo[faction][FactionName]);
						SendClientMessage(para1, COLOR_LIGHTRED, string);
						PlayerInfo[para1][pLeader] = faction;
						PlayerInfo[para1][pMember] = faction;
						PlayerInfo[para1][pDivision] = 0;
					    SetPlayerToTeamColor(para1);
					    OnPlayerSave(para1);
					}
				}
			}
			else
			{
				SendClientMessage(playerid, GREY, "    You are not authorized to use that command.");
			}
		}
		return 1;
	}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)