SA-MP Forums Archive
How add cmd /quitfaction? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: How add cmd /quitfaction? (/showthread.php?tid=162873)



How add cmd /quitfaction? - gondes - 25.07.2010

My script not cmd /quitfaction for leader and i will put this cmd but how to put the cmd?


Re: How add cmd /quitfaction? - R@ger - 25.07.2010

Quote:
Originally Posted by gondes
Посмотреть сообщение
My script not cmd /quitfaction for leader and i will put this cmd but how to put the cmd?
Код:
if(strcmp(cmd,"/quitfaction",true)==0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			if(PlayerInfo[playerid][pMember] >= 1)
			{
	 	     	SendClientMessage(playerid, COLOR_LIGHTRED,"* You have quit your faction, you're now a civilian.");
	     		PlayerInfo[playerid][pTeam] = TEAM_GREEN;
	    		PlayerInfo[playerid][pMember] = 0;
	    		PlayerInfo[playerid][pRank] = 0;
	    		PlayerInfo[playerid][pChar] = 0;
	    		PlayerInfo[playerid][pLeader] = 0;
    		}
			else
			{
				SendClientMessage(playerid, COLOR_GRAD1, "   You are not in a faction or are the leader!");
			}
		}
		return 1;
	}
That might help :P