[HELP] How to remove added classes from class selection?
#1

Hi,
Now I have problems with the class selection. I'd like to do that if a player is off duty as a cop, he can go to a clothes shop and buy a new skin, but if he is on duty he can choose a cop skin there so the civilian skins get disabled and the cop skins get enabled. Is there any way to do this?
Reply
#2

You cant actually remove them but you can make it if the player is selecting a specific skin it will go to another one.

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
  if(GetPlayerSkin(playerid) == /*Skin ID you want to change*/) SetPlayerSkin(playerid, /*Other skin ID*/);
}
I'm not sure if you can do classid = 2 etc.
Reply
#3

Thanks, I solved the first problem, but here is a new one:

I added a lot of skins by two loops, but I can't see them at class selection. It spawns properly if I press the Spawn button, but I can only see the button bar before I spawn.

I add the skins here under OnGameModeInit:

pawn Код:
for(new i = 0; i < sizeof(FerfiAlapSkin); i++)
    {
        AddPlayerClass(FerfiAlapSkin[i][0], 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0);
    }
    for(new i = 0; i < sizeof(NoiAlapSkin); i++)
    {
        AddPlayerClass(NoiAlapSkin[i][0], 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0);
    }
And this is my OnPlayerRequestClass part:

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerInterior(playerid, 0);
    SetPlayerVirtualWorld(playerid, 1);
    if(GetPVarInt(playerid, "Nem") == 1)
  {
    if(GetPVarInt(playerid, "Szervezet") == 1)
    {
    }
    else
    {
      if(GetPlayerSkin(playerid) != FerfiAlapSkin[138][0])
      {
        rand = random(sizeof(FerfiAlapSkin));
        SetPlayerSkin(playerid, FerfiAlapSkin[rand][0]);
      }
    }
  }
  else
  {
    if(GetPVarInt(playerid, "Szervezet") == 1)
    {
    }
    else
    {
      if(GetPlayerSkin(playerid) != NoiAlapSkin[32][0])
      {
        rand = random(sizeof(NoiAlapSkin));
        SetPlayerSkin(playerid, NoiAlapSkin[rand][0]);
      }
    }
  }
    return 1;
}
And I have two long lists at the top of the script that contain the skins you can choose if you are a male or if you are a female. Why can't I see my skins at selection?
Reply
#4

Make sure your camerapos is a few x or y positions away from the playerpos
Reply
#5

Quote:
Originally Posted by [HiC
TheKiller ]
Make sure your camerapos is a few x or y positions away from the playerpos
Thanks, I can see the problem now. The camera's position is the same as the player's position.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)