RequestClass - 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)
+--- Thread: RequestClass (
/showthread.php?tid=345151)
RequestClass -
iGetty - 23.05.2012
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!
Re: RequestClass -
Jonny5 - 23.05.2012
pawn Код:
command(buyclothes, playerid, params[])
{
TogglePlayerSpectating(playerid, 1);
ForceClassSelection(playerid);
TogglePlayerSpectating(playerid, 0);
return 1;
}
Re: RequestClass -
TheDominator - 23.05.2012
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.
Re: RequestClass -
iGetty - 23.05.2012
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