Disabling Class Request without spawning player?
#1

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

https://sampwiki.blast.hk/wiki/OnPlayerRequestClass

have you tried return 0 ?
Reply
#3

I just tried it now and it doesn't do anything, it still shows requestclass.

https://sampforum.blast.hk/showthread.php?tid=542659
Reply
#4

if you want hide that button << >> spawn

might use this
PHP код:
public OnPlayerRequestClass(playeridclassid)
{
    
TogglePlayerSpectating(playeridtrue);
    return 
0;

Reply
#5

As I've said above in my first post. Doing that deletes all my cameras and doesn't allow me to use my creation.
Reply
#6

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(playeridclassid)
{
    if(!
Login[playerid]){
        
TogglePlayerSpectating(playeridtrue);
        
InterpolateCameraLookAt(playerid50.050.010.0, -50.050.010.010000CAMERA_MOVE);
    }
    return 
0;
}
public 
OnPlayerConnect(playerid)
{
    return 
1;

2: delay load Camera:
PHP код:
public OnPlayerRequestClass(playeridclassid)
{
    
TogglePlayerSpectating(playeridtrue);
    return 
0;
}
public 
OnPlayerConnect(playerid)
{
    
SetTimerEx("YOUR_CAMERA_FUNCTION"5000false"i"playerid);
    return 
1;
}
PUBLIC:
YOUR_CAMERA_FUNCTION(playerid)
{
    
TogglePlayerSpectating(playeridtrue);
    
InterpolateCameraLookAt(playerid50.050.010.0, -50.050.010.010000CAMERA_MOVE);

Reply
#7

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?
Reply
#8

maybe this is not the best way to make it,
but you can try it,
it's worked.

PHP код:
public OnPlayerRequestClass(playeridclassid)
{
    
SpawnPlayer(playerid);
    
TogglePlayerSpectating(playeridtrue);
    
SetTimerEx("dealycamera"5000false"i"playerid);
    return 
0;
}
forward dealycamera(playerid);
public 
dealycamera(playerid)
{
    
SetPlayerCameraPos(playerid652.23457.2110.84);
    
SetPlayerCameraLookAt(playerid652.23427.2110.841);
    
SelectTextDraw(playerid0x00FF00FF);
}
public 
OnPlayerConnect(playerid)
{
    
SetSpawnInfoplayerid001958.331343.12999.36269.152636281500);
    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
Reply
#9

Awesome thanks so much!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)