RequestClass
#1

Hello.

I have a command, that sets a player to go onto request class.

here it is:

pawn Код:
command(buyclothes, playerid, params[])
{
    SetPlayerInterior(playerid, 15);
    TogglePlayerControllable(playerid, 0);
    SetPlayerPos(playerid, 218.0603,-98.5880,1005.2578);
    SetPlayerFacingAngle(playerid, 91.4206);
    SetPlayerCameraPos(playerid, 215.7918,-98.6616,1005.2578);
    SetPlayerCameraLookAt(playerid, 218.0603,-98.5880,1005.2578);
    TogglePlayerSpectating(playerid, false);
    OnPlayerRequestClass(playerid, 0);
    return 1;
}
The problem is, it doesn't let me change class? (I mean, the arrows don't come up or anything).

How can I change that?

Thanks!
Reply
#2

pawn Код:
command(buyclothes, playerid, params[])
{
    TogglePlayerSpectating(playerid, 1);
    ForceClassSelection(playerid);
    TogglePlayerSpectating(playerid, 0);
    return 1;
}
Reply
#3

The arrows don't come up because you can hide the arrows with the TogglePlayerSpectating function, here's an example:

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
   TogglePlayerSpectating(playerid, 1);
   return 1;
}

public OnPlayerSpawn(playerid)
{
   TogglePlayerSpectating(playerid, 0);
   return 1;
}
Then the arrows will be hidden.
Reply
#4

Thanks guys! I've got it fixed now!

In the time you both posted, I've added all classes (except the police/medic/fire) ones :P
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)