public bool Restrict([Optional] Client client, [Optional] ExtendetClient extendetClient) { if (extendetClient != null) { client = GetClientByExtendetClient(extendetClient); } else { if (client == null) { return(false); } else { extendetClient = new ExtendetClient(client); } } //TODO: @Koka: Why in module ClientHandler. This should be in module Login //_api.setEntityInvincible(client.handle, true); //_api.freezePlayer(client, true); //_api.setEntityTransparency(client.handle, 0); //_api.setEntityCollisionless(client.handle, true); // Temp extendetClient.Spawn(); return(true); }
public bool SpawnExtendetClient(ExtendetClient extendetClient) { Client client = GetClientByExtendetClient(extendetClient); if (client != null) { client.position = extendetClient.Properties.Position; client.rotation = extendetClient.Properties.Rotation; return(true); } return(false); }
private Client GetClientByExtendetClient(ExtendetClient extendetClient) { Client client = _api.getAllPlayers() .First(c => c.socialClubName == extendetClient.Properties.SocialClubName); if (client == null) { ConsoleOutput.WriteLine(ConsoleType.Warn, $"Unable to get Client from User! Username: {extendetClient.Properties.Name} | SCName: {extendetClient.Properties.SocialClubName}"); return(null); } return(client); }
public bool UnRestrict([Optional] Client client, [Optional] ExtendetClient extendetClient) { if (extendetClient != null) { client = GetClientByExtendetClient(extendetClient); } if (client == null) { return(false); } _api.setEntityInvincible(client.handle, false); _api.freezePlayer(client, false); _api.setEntityTransparency(client.handle, 255); _api.setEntityCollisionless(client.handle, false); return(true); }
public bool UnRestrict([Optional] Client client, [Optional] ExtendetClient extendetClient) { return(SpawnManager.UnRestrict(client, extendetClient)); }
private void OnPlayerDisconnected(Client player, string reason) { ExtendetClient extendetClient = new ExtendetClient(player); extendetClient.Update(true); }