13.08.2013, 22:36
Intro
This is very simple solution for very annoying problem.
Solution
Few days ago I had a problem like this (this is not my image, found it on the internet):
You see that 'spawn button' at the bottom?
While register dialog or login dialog or whatever is showed you can avoid it if 'spawn button' is visible.
Basically you are playing without registration or login.
So to avoid that I figured simple solution.
Add TogglePlayerSpectating(playerid, 1); under your OnPlayerConnect callback.
A little explanation:
TogglePlayerSpectating = Toggle a player's spectate mode
playerid = The ID of the player
1 = TogglePlayerSpectating is ENABLED
While TogglePlayerSpectating is enabled 'spawn button' is hidden.
How to disable it?
We are going to disable it at Register dialog or Login dialog or at any dialog which will proceed to player spawning.
Examples:
A little explanation:
TogglePlayerSpectating = Toggle a player's spectate mode
playerid = The ID of the player
0 = TogglePlayerSpectating is DISABLED
I prefer putting it at the end of your dialog.
Place it under Register dialog and Login dialog.
So that's it.
Please give a try and post your feedback.
This is very simple solution for very annoying problem.
Solution
Few days ago I had a problem like this (this is not my image, found it on the internet):
You see that 'spawn button' at the bottom?
While register dialog or login dialog or whatever is showed you can avoid it if 'spawn button' is visible.
Basically you are playing without registration or login.
So to avoid that I figured simple solution.
Add TogglePlayerSpectating(playerid, 1); under your OnPlayerConnect callback.
pawn Код:
public OnPlayerConnect(playerid)
{
TogglePlayerSpectating(playerid, 1);
// Rest of your code goes here.
return 1;
}
TogglePlayerSpectating = Toggle a player's spectate mode
playerid = The ID of the player
1 = TogglePlayerSpectating is ENABLED
While TogglePlayerSpectating is enabled 'spawn button' is hidden.
How to disable it?
We are going to disable it at Register dialog or Login dialog or at any dialog which will proceed to player spawning.
Examples:
pawn Код:
case DIALOG_REGISTER:
{
// Your code goes here
TogglePlayerSpectating(playerid, 0);
return 1;
}
pawn Код:
case DIALOG_LOGIN:
{
// Your code goes here
TogglePlayerSpectating(playerid, 0);
return 1;
}
pawn Код:
case DIALOG_WELCOME:
{
// Your code goes here
TogglePlayerSpectating(playerid, 0);
return 1;
}
pawn Код:
case DIALOG_ANYTHING:
{
// Your code goes here
TogglePlayerSpectating(playerid, 0);
return 1;
}
TogglePlayerSpectating = Toggle a player's spectate mode
playerid = The ID of the player
0 = TogglePlayerSpectating is DISABLED
I prefer putting it at the end of your dialog.
Place it under Register dialog and Login dialog.
So that's it.
Please give a try and post your feedback.