Disabling Class Request without spawning player? -
Tass007 - 28.11.2016
Hey guys. I've come up with my own sort of class request sort of thing and I don't want the server to have OnPlayerRequestClass is there any way to bypass or disable? I've done all the
PHP код:
public OnPlayerRequestClass(playerid,classid)
{
SpawnPlayer(playerid);
return 1;
}
However I don't want to spawn the player, I want them to stay in "Camera Mode" without spawning them until they press my created "Spawn" button.
I've tried TogglePlayerSpectating(playerid, true); however that ruins all the cameras and my create class request sort of thing.
Does anyone have any ideas??
Re: Disabling Class Request without spawning player? -
Alvitr - 28.11.2016
https://sampwiki.blast.hk/wiki/OnPlayerRequestClass
have you tried return 0 ?
Re: Disabling Class Request without spawning player? -
Tass007 - 28.11.2016
I just tried it now and it doesn't do anything, it still shows requestclass.
https://sampforum.blast.hk/showthread.php?tid=542659
Re: Disabling Class Request without spawning player? -
Alvitr - 28.11.2016
if you want hide that button << >> spawn
might use this
PHP код:
public OnPlayerRequestClass(playerid, classid)
{
TogglePlayerSpectating(playerid, true);
return 0;
}
Re: Disabling Class Request without spawning player? -
Tass007 - 28.11.2016
As I've said above in my first post. Doing that deletes all my cameras and doesn't allow me to use my creation.
Re: Disabling Class Request without spawning player? -
Alvitr - 28.11.2016
i'm sorry x___x..
there's 2 way can make that as i know,
1: check player login or not, and use camera in OnPlayerRequestClass
PHP код:
public OnPlayerRequestClass(playerid, classid)
{
if(!Login[playerid]){
TogglePlayerSpectating(playerid, true);
InterpolateCameraLookAt(playerid, 50.0, 50.0, 10.0, -50.0, 50.0, 10.0, 10000, CAMERA_MOVE);
}
return 0;
}
public OnPlayerConnect(playerid)
{
return 1;
}
2: delay load Camera:
PHP код:
public OnPlayerRequestClass(playerid, classid)
{
TogglePlayerSpectating(playerid, true);
return 0;
}
public OnPlayerConnect(playerid)
{
SetTimerEx("YOUR_CAMERA_FUNCTION", 5000, false, "i", playerid);
return 1;
}
PUBLIC:YOUR_CAMERA_FUNCTION(playerid)
{
TogglePlayerSpectating(playerid, true);
InterpolateCameraLookAt(playerid, 50.0, 50.0, 10.0, -50.0, 50.0, 10.0, 10000, CAMERA_MOVE);
}
Re: Disabling Class Request without spawning player? -
Tass007 - 28.11.2016
It's all goods. Hummm I'm just using SetPlayerCameraPos, but I can't be in Spectating mode as my class creation is using TextDraws and in order to click on textdraws I need to use SelectTextDraw and I can't use SelectTextDraw whilst in spectating mode. Are there no other possible ways?
Re: Disabling Class Request without spawning player? -
Alvitr - 28.11.2016
maybe this is not the best way to make it,
but you can try it,
it's worked.
PHP код:
public OnPlayerRequestClass(playerid, classid)
{
SpawnPlayer(playerid);
TogglePlayerSpectating(playerid, true);
SetTimerEx("dealycamera", 5000, false, "i", playerid);
return 0;
}
forward dealycamera(playerid);
public dealycamera(playerid)
{
SetPlayerCameraPos(playerid, 652.23, 457.21, 10.84);
SetPlayerCameraLookAt(playerid, 652.23, 427.21, 10.84, 1);
SelectTextDraw(playerid, 0x00FF00FF);
}
public OnPlayerConnect(playerid)
{
SetSpawnInfo( playerid, 0, 0, 1958.33, 1343.12, 999.36, 269.15, 26, 36, 28, 150, 0, 0 );
return 1;
}
https://sampwiki.blast.hk/wiki/SetPlayerCameraPos
Quote:
You may also have to use SetPlayerCameraLookAt with this function in order to work properly.
|
https://sampwiki.blast.hk/wiki/SetPlayerCameraLookAt
final
https://sampwiki.blast.hk/wiki/SelectTextDraw
Re: Disabling Class Request without spawning player? -
Tass007 - 28.11.2016
Awesome thanks so much!