SA-MP Forums Archive
Change Player Skin Also Based On A Rank - 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: Change Player Skin Also Based On A Rank (/showthread.php?tid=161395)



Change Player Skin Also Based On A Rank - robert4049 - 19.07.2010

Okay so my FD needs to be able to do /bunkergear and they get well bunker gear. but the thing is i need the bunker gear skin to be based on the player's rank in that faction.

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext, "/bunkergear", true) == 0)
    {
        SetPlayerSkin(playerid, 277);
        return 1;
    }
    return 0;
}
is a basic command.
and i know i need faction type 2 and the rank is 1 so.... it should be this
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext, "/bunkergear", true) == 0)
    	if(PlayerInfo[playerid][pFaction] != 255 && DynamicFactions[PlayerInfo[playerid][pFaction]][fType] == 2)
			{
				if(PlayerInfo[playerid][pRank] != 1)
{
        SetPlayerSkin(playerid, 277);
        return 1;
    }
    return 0;
}
and like if the player rank is 3 it should make it skin id 278
and that would be like this
Код:
    	if(PlayerInfo[playerid][pFaction] != 255 && DynamicFactions[PlayerInfo[playerid][pFaction]][fType] == 2)
			{
				if(PlayerInfo[playerid][pRank] != 2)
{
        SetPlayerSkin(playerid, 278);
how would i put those two in with one another.


Re: Change Player Skin Also Based On A Rank - John_F - 19.07.2010

how abt an else if rather than an if in the 2nd one?


Re: Change Player Skin Also Based On A Rank - robert4049 - 20.07.2010

would that work? lol.


Re: Change Player Skin Also Based On A Rank - Dudits - 20.07.2010

Yup, make it check the player's rank, if it's 1 then get skin id, else if it's 2 then get another skin id.


Re: Change Player Skin Also Based On A Rank - robert4049 - 20.07.2010

i got it ima use this.
[code] if(PlayerInfo[playerid][pFaction] != 255 && DynamicFactions[PlayerInfo[playerid][pFaction]][fType] == 2)
{
if(rank == 1)[code]


Re: Change Player Skin Also Based On A Rank - robert4049 - 20.07.2010

so wait is this right
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext, "/bunkergear", true) == 0)
    	if(PlayerInfo[playerid][pFaction] != 255 && DynamicFactions[PlayerInfo[playerid][pFaction]][fType] == 2)
			{
			if(PlayerInfo[playerid][pRank] != 1)
		{
        SetPlayerSkin(playerid, 277);
		}
			else(PlayerInfo[playerid][pRank] != 2)
		{
        SetPlayerSkin(playerid, 276);
    	}
			else(PlayerInfo[playerid][pRank] != 3)
		{
        SetPlayerSkin(playerid, 278);
    	}
			else(PlayerInfo[playerid][pRank] != 4)
		{
        SetPlayerSkin(playerid, 279);
		}
			else(PlayerInfo[playerid][pRank] != 5)
		{
        SetPlayerSkin(playerid, 280);
		}

		return 1;
	}
	return 0;
}