/quitfaction command
#1

I made a /quitfaction command but when players use it they have the same skin and team
even though i have set the [pSkin] and [pTeam]
Reply
#2

Try this one..
pawn Код:
if(strcmp(cmd, "/quitfaction", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, " /quitfaction ");
                return 1;
            }
       if(PlayerInfo[playerid][pMember] >= 1)
       {


                           
                            format(string, sizeof(string), "You have left your faction.");
                            SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                           gTeam[playerid] = 3;
                            SetPlayerHealth(playerid, 0);
                            PlayerInfo[playerid][pTeam] = 3;
                            PlayerInfo[playerid][pLeader] = 0;
                            PlayerInfo[playerid][pMember] = 0;
                            PlayerInfo[playerid][pRank] = 0;
                            PlayerInfo[playerid][pChar] = 0;
                            new rand = random(sizeof(CIV));
                            SetSpawnInfo(playerid, gTeam[playerid], CIV[rand],0.0,0.0,0.0,0,0,0,0,0,0,0);
                            PlayerInfo[playerid][pModel] = CIV[rand];
                            MedicBill[playerid] = 0;
                            SpawnPlayer(playerid);
                        }

                }//not connected
           

        }
        return 1;
    }
Reply
#3

I start to compile and jumps out an empty window why it occurs?!
Reply
#4

Im using that one, and its working perfect.
pawn Код:
if(strcmp(cmd, "/quitteam", true) == 0)
{
    if(PlayerInfo[playerid][pMember] == 0)
    {
        SendClientMessage(playerid, COLOR_GREY, "  You are Civilian. Can't do that !");
        return 1;
    }
    if(PlayerInfo[playerid][pLeader] > 0)
    {
        SendClientMessage(playerid, COLOR_GREY, "  Ask an admin to remove your leader !");
        return 1;
    }
    SendClientMessage(playerid, COLOR_BLUE, "You are now a Civilian again !");
    PlayerInfo[playerid][pMember] = 0;
    PlayerInfo[playerid][pTeam] = 3;
    gTeam[playerid] = 3;
    PlayerInfo[playerid][pRank] = 0;
    PlayerInfo[playerid][pLeader] = 0;
    PlayerInfo[playerid][pChar] = 0;
    SetPlayerToTeamColor(playerid);
    SetPlayerSkin(playerid, PlayerInfo[playerid][pModel]);
    return 1;
}
Reply
#5

If not try this

Код:
	if(strcmp(cmd, "/quitteam", true) == 0)
	{
		if(PlayerInfo[playerid][pMember] == 0)
		{
			SendClientMessage(playerid, COLOR_GREY, "  You are Civilian. Can't do that !");
			return 1;
		}
		if(PlayerInfo[playerid][pLeader] > 0)
		{
			SendClientMessage(playerid, COLOR_GREY, "  Ask an admin to remove your leader !");
			return 1;
		}
		{
			SendClientMessage(playerid, COLOR_YELLOW, "You are now a Civilian again !");
			PlayerInfo[playerid][pMember] = 0;
			PlayerInfo[playerid][pTeam] = 3;
			gTeam[playerid] = 3;
			PlayerInfo[playerid][pRank] = 0;
			PlayerInfo[playerid][pLeader] = 0;
			PlayerInfo[playerid][pChar] = 0;
			SetPlayerToTeamColor(playerid);
			SetPlayerSkin(playerid, PlayerInfo[playerid][pModel]);
			return 1;
		}
	}
Reply
#6

hey i wanna know how i add it to my script??
Reply
#7

Copy it and paste it under 'public OnPlayerCommandText' or under another command e.g /quitjob
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)