15.11.2017, 01:09
Base
PHP код:
enum e_PLAYER_INFO
{
bool:Logado,
}
new
Player[MAX_PLAYERS][e_PLAYER_INFO];
public OnPlayerRequestClass(playerid, classid)
{
if(!Player[playerid][Logado])
{
TogglePlayerSpectating(playerid, true); // esconde o botгo de spawn
return true;
}
return true;
}
public OnPlayerSpawn(playerid)
{
if(!Player[playerid][Logado])
{
Player[playerid][Logado] = true;
}
return true;
}
public OnPlayerRequestSpawn(playerid)
{
return Player[playerid][Logado];
}
public OnPlayerLogin(playerid) // Onde serб executado a query de login para carregar as informaзхes/dados do banco de dados.
{
if(Player[playerid][Logado])
return false;
// Preencha a funзгo abaixo.
SetSpawnInfo(playerid, 0, skin, x, y, z, rotation, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo); // seta a posiзгo do spawn e +
SendClientMessage(playerid, -1, "autenticado com sucesso.");
TogglePlayerSpectating(playerid, false); // "spawna" o jogador
return true;
}