Delete button spawn
#1

Hello.

When a new player come on my server, he has to register. The problem is that there is a spawn button and the player can play if he isn't registered.

My question is how to delete the spawn button and just spawn the player when I do SpawnPlayer(playerid) ?

Thanks !
Reply
#2

Quote:
Originally Posted by Urefeu
Посмотреть сообщение
Hello.

When a new player come on my server, he has to register. The problem is that there is a spawn button and the player can play if he isn't registered.

My question is how to delete the spawn button and just spawn the player when I do SpawnPlayer(playerid) ?

Thanks !
If you want them to not spawn until they log in you could do the following:-

pawn Код:
if( !IsPlayerLoggedIn( playerid ) ) // change this to your own var
    {
        SendClientMessage( playerid, -1, "Error: You must log in before you spawn!" );
        return 0;
    }
Put this in OnPlayerRequestSpawn and your problem will be fixed

Regards,
FalconX
Reply
#3

Force the player into spectator mode when the player connects with
pawn Код:
TogglePlayerSpectating(playerid, 1);
Then, before he spawns, force them out.
Reply
#4

return 0; don't fonction

How to set the camera of the player in an other place ?

I have put : SetPlayerCameraPos(playerid, -2031.539184, -116.349197, 1036.240234); at the begining of the OnPlayerConnect, but it change anything ...
Reply
#5

pawn Код:
//Under OnPlayerConnect
TogglePlayerSpectating(playerid, 1);

//After register /Login
TogglePlayerSpectating(playerid, 0);
Reply
#6

TogglePlayerSpectating function, the spawn button has disappeared.

Now, I have two problems :

- When the player logs, I do : TogglePlayerSpectating(playerid, 0); (When the spectating is turned off, OnPlayerSpawn will automaticly be called.). The problem is that, when the player logs, the player doesn't spawn : the spawn button appears and the player has to click it for spawn. I added SpawnPlayer(playerid); but it doesn't function...

- I do TogglePlayerSpectating(playerid, 1); I have a view over a sea. How to change it ? On a lot of servers, there is a view on offices during connection or registration...

Thanks in advance !
Reply
#7

Any idea ?
Reply
#8

Quote:
Originally Posted by Urefeu
Посмотреть сообщение
TogglePlayerSpectating function, the spawn button has disappeared.

TogglePlayerSpectating(playerid, 0); (When the spectating is turned off, OnPlayerSpawn will automaticly be called.!
Actually , OnPlayerSpawn is not called..
OnRequestPlayerClass is called.

Also, show the code and try this
pawn Код:
SetSpawnInfo(playerid......)//All the things needed
https://sampwiki.blast.hk/wiki/SetSpawnInfo
Reply
#9

I have already done that :

Код:
public OnPlayerRequestClass(playerid, classid)
{
    SetSpawnInfo(playerid, 0, 217, 4687.5126, 1520.8243, 8.2256, 1.5945, 0, 0, 0, 0, 0, 0);
    
	return 1;
}
Reply
#10

It not functions :/ An other idea ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)