Change Player Skin Also Based On A Rank
#1

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.
Reply
#2

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

would that work? lol.
Reply
#4

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.
Reply
#5

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

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;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)