25.08.2014, 00:06
Ok when you use TogglePlayerSpectating(playerid, false); OnPlayerSpawn is called, up there all right.
When you use TogglePlayerSpectating(playerid, true); in OnPlayerRequestClass and subsequently you use TogglePlayerSpectating(playerid, false); kick player only if it is the first time the player enter the server, if OnPlayerRequestClass is called by F4 reason no kick player.
Ok, sorry my bad english.
But if you put SpawnPlayer(playerid) below TogglePlayerSpectating(playerid, false), player hasn't kicked but OnPlayerSpawn is called twice.
By F4 no kick:
Sorry for my bad english.
I do not know if is a bug or script problem, but using this no kick (Onplayerspawn called twice)
TogglePlayerSpectating(0, false);
SpawnPlayer(0);
When you use TogglePlayerSpectating(playerid, true); in OnPlayerRequestClass and subsequently you use TogglePlayerSpectating(playerid, false); kick player only if it is the first time the player enter the server, if OnPlayerRequestClass is called by F4 reason no kick player.
Ok, sorry my bad english.
pawn Код:
new ads;
public OnPlayerConnect(playerid)
{
ads = 1;
//GameTextForPlayer(playerid,"~w~SA-MP: ~r~Bare Script",5000,5);
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
if(ads == 1)
{
TogglePlayerSpectating(playerid, true);
SetTimer("asdj", 1000, 0);
}
return 1;
}
forward asdj();
public asdj()
{
ads = 0;
//Here kick player and OnPlayerSpawn/OnPlayerRequestClass is not called, only kick the player.
TogglePlayerSpectating(0, false);
}
pawn Код:
forward asdj();
public asdj()
{
ads = 0;
//Here no kicks but OnPlayerSpawn is called twice.
TogglePlayerSpectating(0, false);
SpawnPlayer(0);
}
By F4 no kick:
pawn Код:
public OnPlayerSpawn(playerid)
{
ads = 1;
SetPlayerPos(playerid, 324.7515, -1829.8098, 4.3855);
SetPlayerInterior(playerid,0);
TogglePlayerClock(playerid,0);
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
if(ads == 1)
{
TogglePlayerSpectating(playerid, true);
SetTimer("asdj", 1000, 0);
}
return 1;
}
forward asdj();
public asdj()
{
ads = 0;
//no kick player
TogglePlayerSpectating(0, false);
}
I do not know if is a bug or script problem, but using this no kick (Onplayerspawn called twice)
TogglePlayerSpectating(0, false);
SpawnPlayer(0);